really optimized two queries