refactored calendar class