IDEX-1323: code refactoring