Refactor get_by_year