Network communication refactoring