CreateIndex improvements from codereview