Removed unused for loop
Refactoring