some refactoring and started adding in a MockStore for testing purposes