modify factory method pattern