refactory ScheduleService.cs and Worker.cs