Improve function interface for relaying messages