refactoring: removed duplicated sending code