refactor networkcontroller