Some renaming and refactoring