ERT-437: Many 'trivial' reformattings: name changes; introduced local scopes; moved code lines.