code cleaning in plugins.js