Reduce function registration boilerplate with macros