plugin rewrite with new features