Clean code in calendar controller