Refactoring execution of tests