jiraId:MAR-457 yet more refactoring