refactor store management