refactor Network