Refactoring some files