Refactoring cron