Refactored data structure so the app is more independent from the data structure