refactor store factory