Add docblocks and clean-up.