Base plugin code