finish refactoring of network controller