use 'with' on lock pattern
continue refactoring of msgnet support