replacing external each and clone components with lodash