Cleanup, rewrite scheduler.