Issue #12: Refactored ScheduleDatabase and ScheduleContract as per code review.