refactorings for diagnostics support