clean-up and documentation