Optimized getType