rewrite layout utility