plugin master refactor