Remove use of redundant variables, cleanup