refactored struct of the app