Moved storage code to separate module.