Decouple storage

We want to make it easy to decouple the storage mechanism from the internal logic.