cleanup and some documentation