Add prefix argument, rewrote template name generation code