Cleaning up evaluateCommand
Error - but cleaner code.