Move storage functions to separate module.