Fixed all the commands - Pass 1
Also removed redundant imports and cleaned up the code
Fixed all the commands - Pass 2
Also removed redundant imports and cleaned up the code