Use one combined query instead of three