Plugins: improved Peperoni code (WIP)