some code cleanup and added incode doc