Add a macro to reduce duplicated code in Proxy classes.