Small Refactoring
Major refactoring of the plugin