Code optimization for Item search