protected function retrieve(Direction $direction, string $class): \ArrayIterator
    {
        $d = (string) $direction;

        $hydrate = function (EncapsulatedEdge $encapsulated): EdgeInterface {
            if(!$encapsulated->hydrated())
                return $this->master->edge($encapsulated->id());
            return $encapsulated->edge();
        };

        $filter_classes = function (EncapsulatedEdge $encapsulated) use ($class): bool {
            return in_array($class, $encapsulated->classes());
        };

        if(empty($class)) {
            return new \ArrayIterator(
                array_map($hydrate, $this->$d)
            );
        }

        return new \ArrayIterator(
            array_map($hydrate, 
                array_filter($this->$d, $filter_classes)
            )
        );
    }