refactor commands a bit