IDEX-811; IDEX-706: code refactoring