Revert "Refactor plugin re"

This reverts commit 17c0d9f58bf98215946e372edd1548a6d9e0a9ae.