More refactoring and renaming