Optimized the Calendar's functionality