start_batch_search code refactor and rspec test