Completed. refactor and cleanup remain
Passed all unit tests.