working on pulling out some common networking functionality.