4 Chapter The factory pattern