Calendar generation refactor