Re-structuring the plugin