Refactoring.

Implemented interactive search for command.