Index creation in its own function.