use template

- pass only the file to the different methods
- use template
    - do not escape the file name manually