Refactor network building logic into the compiler namespace.
Remove unnecessary system-env construct for simplicity.