Internal cleanup, incorporate Ryan's changes, no functionality change (I hope!)
Authored by: watusimoto 2009-06-03
Parent: [r407]
Child: [r409]