moved scheduler to separate js file and made it an object