bring file path transform into a function