minor refactor, changed some var names