Refactor measure width implementation