minor optimization to previous commit