variables cleanup and slight renaming