Refactor tests [ci skip]