code layout from appcode