Various changes for the plugin's mechanics

I have tested code locally. If there are any errors when set up on your system, let me know about it ASAP.