Refactor plugins.

subj