code cleanup, variable renaming