calendar  refactored