change plugin registration to a more generic way