Added factory methods for repositories.