Optimized plugin and moved things around