Added Scheduler. Refactored.