Refactored the test a bit