implementing month format and refactoring