Refactores storage
Adds doc comments + some refactoring