used lodash isArray
used lodash flatten
simplified checkbox handling with .prop()