cleanup, bugfixing, testing