Refactor for measuring.