Remove unnecessary call to input.index()