Remove duplicate code. Replace _.each with forEach.