Updated the templates and scripts to be more flexible and less hard-coded