small bugfixes, refactor and fixed log format
config