First implementation for getSchedule + cleaner code.