refactored to take scope options directly from scope