Minot refactor and cleanup