Tests: refactoring