implemented an interface and factory design pattern for instantiating the model.