Various refactoring, mainly renaming.