Improved plugin initialization