Complete rewrite using lenses.