use functors for message passing operations