Added missing bracket to template code.
Added code to getFactory function to replace the various placeholders in the template file.