XD-1434 Code-review changes + polishing