Refactor width getter a bit.