Refactoring complete.  But crude...

Need to check in before losing state.