ECMS-6183: Remove duplicated code