More refactoring - use forEach over for..in