Chore/cleanup

various cleanups. Mostly atomic commits.