Cleanup documentation and some code