Refactor search, move query matching to item itself