Refactor layouts.