implement new plugin system (partially working)