Add more docs
Move more types internal, reorg the file to make it flow better