Major refactor and renaming.