Update docs and clean up code format.