refactor-unit-tests-#28

Almost ready