Rewrite gui plugin