Added more optimization to the GO term querying.