latest code fixes for refactoring Measurement Service