Remove redundant variables