CRM-15226 move generic code out of specific class
Merge pull request #4443 from eileenmcnaughton/CRM-15526

CRM-15226 move generic code out of specific class