fixed patching for config and template files, also fixed scheduling to use cron expression
some cleanup and refactoring