Removes redundant code in CommandSearch