consider extracting this out into a collections partial. look it up