split index into its own scope