clean up configuration,  move diagnostics to portable lib