improved the plugin main file