CRM-15226 move generic code out of specific class