clean-up & bugfixes