Factored out base.fill_template function
Removed always-true conditionals
Better handling (and documentation) of MockCreationError