refactoring search block method.