Make additional path name checks more flexible by offering a custom function call