use macro to define class