imrpove error handling, new config management