Plugin Rewrite

rewritten Plugin for modular use