refactored to app with pages