Refactoring to support monthly data more correctly