improved performance via base type constants and table lookup