Repository: the implementation is slightly simplified.