Move general function from network-wrapper cookbook to common-wrapper libraries