minor optimization. #787