Simplify more and add some documentation.