expand factory pattern with abstract class and methods