Adds refactoring of tests