restructured app to display inside a popup