protected function createRoute($value)
    {
        if ($value instanceof Route) {
            return $value;
        }
        
        if (is_array($value)) {
            $value = (object)$value;
        }
        
        if (is_object($value) && is_callable($value)) {
            $value = (object)['fn' => $value];
        }
        
        if (!$value instanceof \stdClass) {
            throw new \InvalidArgumentException("Unable to create a Route from value " . var_export($value, true));
        }
        
        return new Route($value);
    }