On direct products of theories