Updated to use new layout code