improve plugin functions