cleaning up some test cases
refactoring a bit