Using underscore's magic allowed me to simplify this a little bit