changed factory method to abstract method