calendar refactor