protected function build(string $modelClass): IRepository
    {
        $repositoryClass = $this->registeredRepositories[$modelClass] ?? Repository::class;

        $parameters = [];

        if ($repositoryClass === Repository::class || is_subclass_of($repositoryClass, Repository::class)
        ) {
            $parameters = ['modelClass' => $modelClass];
        }

        return $this->container->make($repositoryClass, $parameters);
    }