Cleaned up code

Removed unnecessary checks and made it utilize the command class a bit more.