some more clean-up and fixes