Added tests for year. Refactored accordingly.