clean-up and fixes