refactor plugin.h