Command execution refactor

Fucktored the commands and their execution logic.