Refactoring: add a function to search for a template file.