Mike's cleanup PR with merge conflicts fixed