refactored to activty