Code refactoring and typo fixing

Refactoring scheduled jobs, fixing small bugs