Dipolar theory of ferroelectrics revisited