Extract templates to another file