refactor use templates for file options