restructuring to fix cron task loading problem