Code refactored. width made common