Refactor test a bit