generalized primitive type handling