Sort out variable renaming mess