move files to components and adapt app to state service