Lots of cleanup
Some additional documentation