Restructured the main plugin class