Refactor leap year

Add tests
DRY running code