use macros for state accessors