minor cleanup and some comments