flexibility: support more types - integral, enum, classes