leap year refactor