Changing plugin to a class