Refactoring: extract removing object at specified index to separate function