refactoring some files