refactor send / broadcast functions