Refactor plugin to expose some methods