Refactor cron