calendar refactoring