refactored sample activity