Refactor broadcast and receive plugin.