cleanup code
more code refactor
Merge pull request #3 from stdweird/templating_for_job_regtest

cleanup code