cleanup plus a couple of TODOs