reimplementing nested enum support