Some unit tests refactored (more still to work on)