Clean up some of this code a tiny bit, no functionality change.