remove second call to indexOf