Refactor storage functions
Simplify restoring functions
Improve notation
Improve notation