moved object creation for layout to app controller