Generalize for an arbitrary type