WIP: plugins rewrite