Add factory methods to service and repository