refactored calendar initialization