More code clean up and doc updates