move messaging.go to package network