Simplify by eliminating extra variables