some cleanup and docs