inline calendar refactoring