Refactoring index parameter handling to have the same code style as others