use layout instead of writing directly to container