Refactored config and template generation to separate script
Refactored config and template generation to separate script