add factory method pattern