refactoring calendar template structure in Prototype