refactoring cron system