move protocol struct to protocol.go