Minor refactor for presence_api_test