Clean up some code in action metrics