Review @dandv's code and minor cleanup