constructor that is given a factory