Updates to remove external query dependency