refactored to take scope store