Convert iterations with index variable to forEach loop.
Uses contains instead of indexOf with comparison.
Converts while iteration to for each loop.
Removes try/catch block as exception is immediatly rethrown.
Removes exceptions in method signatures which are never thrown and removes the corresponding catch clauses as well.