More optimizations for scheduling