Cleanup code to make it easy to remove the PAPI code.
