python: more net refactoring