@Override
    public Operation create(Scanner scanner) throws FactoryException {
        try {
            String metric = scanner.next();

            if (metric.equals("pixelcount"))
                return new SearchOperation(saved, new PixelCountMetric());
            else if (metric.equals("uniquechars"))
                return new SearchOperation(saved, new UniqueCharsMetric());
            else
                throw new FactoryException();

        } catch (Exception ex) {
            throw new FactoryException();
        }
    }