replace bolierplate with macros