move cron job function to core