Continued working on the refactoring and testing.