rewritten structure to enable seperate plugins