templates functionality in a new file