Refactor plugin generator