Modularized the use of the calendar view.