Put similar code in plugins.js