refactored search component