module plugin refactor