More documentation and a bit of clean up