Refactor store to isolate file handling