Refactor transformer methods to not use indeces in getting the measurement value

Reviewer: Tiffany Go

Issue: GCP-8779