clean up and document a bit