Added plugin refresh method and optimized.