Refactors the leapyear class.