[Mercy] refactoring sending of commands to arduino device