write factory method for creating polls