Rewrite plugin using functional inheritance