Refactor code in order to add persistance
Add persistance