rewrite layout