Refactor tests just a bit