Split up the calendar code into more manageable chunks.