A device for improving the function of a heart valve has a first and a second shape. The device comprises two contact points, and the device in the first shape exhibits a distance between the two contact points essentially corresponding to a distance between two commissures of the heart valve and the device in the second shape exhibits an increased distance between the contact points. The device is in the first shape arranged for insertion to the heart valve to establish a contact between the contact points and the commissures. The device is transferable from the first shape to the second shape, and the device is in the second shape arranged for extending in abutment with valve tissue throughout a cycle of heart action. The device may change the shape of the heart valve by stretching it between the commissures for improving the ability of the heart valve to close.