More cleanup + inline docs.