add the factory pattern using the module approach as there is no abstract class in ruby