restructuring the complete plugin