IDEX-1708: code refactoring