rewrite plugin base