refactor file builder