Unify ACTION_PROFILE_xx handling code