search content tests and refactoring