Files refactoring and other minor changes