network refactor