Refactor get file to OOP