remove lodash - only a single loop
remove unused function