Improve duplicate methods in search testing