refactoring. We want to use the same code in the activity (for testing) as well asin the Extension