netowork refactor