rebuilt structure of app into different files