refactor binary file