Updated repository to use getPublishedWhen()