large refactoring to month printing logic