refactor for generics, and add convenience methods to TripleIteratorFactory to reduce object creation