move default layout handling in its own class