Some boring work: func docs and cleaning