Finished refactoring networking