add factory method at python