Support more flexible datatype and scaling parameters.