cleanup, fix a TODO, eliminate dead code.