improve doc comment, use tmp var instead of repeating method call