optimize tests and use bulk_index