Completion of refactor and validation that this still works.