More refactor.  Now somewhat clean.