code cleanup, updated naming of some parameters