Improve plugin architecture