Refactor and unit test coverage for core/stores