refactored format_week and format_year methods, created various helper methods