Trying to refactor the store

Want a commit before I screw things up.