rearrange files and references to them