a lot of refactoring and bugfixing