restructured some code in the plugin, restructured the tests