DRI 

moved repeated functionality into helper function.