Rewrite more macros
- Issue: the cast logic need better impl. Otherwise the ref and the real value is different for bool type