lots of refactoring/bugfixing for tissuestack