Move create-reference-files function from templates to utils