refactored search module