Radical changes in basic patern

I changed the structure the basic plugin pattern.