Tool and shared code for all versions of API.