further refactoring of CStore code