Refactor tests a bit