Measuring state refactored