rewrite userSpan; shorter and nicer code