minot refactoring/cleanups