minor refactoring of scripts, cron needs to change with updating script