Adapt reflection implementation to macro implementation
Reuse implementation for both macros and reflection based api