move index creation to an initializer