[IMP]: use subtype instead of condition and code optimization