Cleanup: simplify some code.