refactor measurements