Improve send function