Cleaned up how metrics are exported.