add factory method example