Refactor search mechanism to use channels so we can reuse code better