Simplifies some common subexpressions.

No functional change.
Some more TODO entries.