refactor calendar application