factor out width_of