break build inputs check into simpler queries