IDEX-706, IDEX-811: Code refactoring