Extract templates into new file