refactored command class to implement Predicate and Completer