bugfixes of the refactoring