Converting cron job to use model for scheduler and slot