improves scheduling logic