Manipulating expressions using structure