This is mostly copy & paste of `public <U extends ModelRepository> U createRepository(Class<U> repositoryClass)`. Please refactor to get rid of the duplicated code.