Refactoring structure of all files