Fix refactoring bugs
Add cron job