Add logic for running device commands