Base logic and structure of plugin