refactor cron