Refactor return of table filename from function to argument.