TEST-9 add some TDD and cleanups