Additional cleanup and renaming for clarity.