refactoring a few files