Simplify and optimize.