Refactor search module; WIP