Remove half hearted di

and other minor refactors

largely a result of comments by @akatz