modify layout and use popup pattern