port over some of Eric's refactoring from trunk
Authored by: jswhit 2007-11-18
Parent: [r4369]
Child: [r4371]