refactoring of some files