push some of the grunt work out to a new helper class