Removed EnumerateWithIndex methods + some refactorings.