rewrite method