private function createTokenNode($tokenName, $defaultClass, $tokenInterface, $defaultTtl)
    {
        $builder = new TreeBuilder();
        $node = $builder->root($tokenName);
        $node
            ->addDefaultsIfNotSet()
            ->children()
                ->integerNode('ttl')
                    ->defaultValue($defaultTtl)
                ->end()
                ->scalarNode('class')
                    ->cannotBeEmpty()
                    ->defaultValue($defaultClass)
                    ->validate()
                        ->ifTrue(function ($accessTokenClass) use ($tokenInterface) {
                            return !(
                                class_exists($accessTokenClass, true)
                                && (new \ReflectionClass($accessTokenClass))
                                    ->implementsInterface($tokenInterface)
                            );
                        })
                        ->thenInvalid(sprintf(
                            'Provided access_token configuration has to be a valid class which implements %s.',
                            $tokenInterface
                        ))
                    ->end()
                ->end()
                ->append($this->createDriverStrategyNode('loader'))
                ->append($this->createDriverStrategyNode('repository'))
            ->end()
        ;

        return $node;
    }