Refactoring; cleaning code, replacing iterators with for loops; replacing Object with actual types in maps