refactor for total width