Clean up and document a bit