improved plugin loading