Refactor commands and add more args check