cleaning + bugfixing