more cleanups of discrete range and range traits code