Added Factor template to prime generator