* Refactor to separate the database bits from the UI bits