Unit testing refactoring

End the unit testing refactoring