Refactor test a little bit