More clean-up and some variable renaming.