Refactor item search