Transform plugin registration into macros to avoid unnecessary code duplication