[RBE-71] fix and unit tests