refactor for File Adapter