This was some legacy code from the old erb view. Will see if it can be improved with this commit.