Refactor race test