Made layouts recursive