We review that classical notion of Kalman filters for state estimation in dynamical systems. We then reformulate the estimation problem as an optimization problem and show how this perspective allows one to overcome many of the perceived barriers to extending the basic model to a wide range of novel settings. In particular, we show how to extend the model to nonlinear settings involving state constraints, non-Gaussian densities, outliers, sparsity, trend shifts, and state dependent covariances. Illustrations of these ideas on numerical simulations as as well as real data sets will be presented.