More refactoring.  God, this is a hideous cludge.