cleaned up the scheduler