IDEX-1284: add tests, remove useless code