Simplify some of the code. No functionality change.