simplify the processing and use underscore to filter the array.