Fixed factory method definition