Move measurement from activity to service