integrate code to layout