Extract send command logic from AUTOLOAD; make it more robust