Updated the repo query to be more efficient