such refactor!

moving out all local storage functions to seperate module