simple factory and factory method