refactor diagnostics
place verify at the end