clean up this code a bit, no functionality change