refactored to make measurable