bugfixes, config refactoring