fix and clean-up