Refactor search insert position