scratchpad code for faster key metrics