created a factory method example