config refactoring and fixes
adding logging + minor fixes