Move index setup to a script