refactor device commands
refactor commands