sample_store: A bit of refactoring