restructuring the app