Some more refactoring and renaming