Reimplemented all the logic using a JSON file as data source.