minor error message elaboration
refactor unit test to make it more unit testy