Removed from $.each loops for efficiency