restructure files and fix cron job bug