Rewrite layout