Refactored plugin.