Issue refs #1744: done (fix errors localization, refactor some boilerplate code)