initial support for nested layouts
Use recursion for unlimted nested layouts