add factory method to dp