add a template function for createStoreFor