class CommandFactory {

  protected Optional<Command> create(final String keyword) {
    final Command command = createInternal(keyword);
    if (command instanceof AbstractCommand) {
      ((AbstractCommand) command).setPrinter(printer);
    }
    return ofNullable(command);
  }

}