reorganize web app with nested states