Finish xml documentation, clean up unused code