BZ-10553 fixes, tweak, refactoring