CRM-13793 code cleanup