Refactored plugin setup to pass instance objects