refactor for file param