more refactor
add plotter, diagnostics