Made a structure for the commands

Changed the code accordingly
Changed the code a bit due to new cmd structure