couldn't this helper function be replaced by a map-call?