documentation and clean-up