extract storage.js into a seperate module