First iteration of Factory pattern