Refactored redundant for loop
Merge origin/master