refactor memory mapping files