CMS-2956 Refactor long methods