start to rewrite interface type recognition