Feature/misc cleanup

Plan to do some more cleanup on this branch.