abstracting a bit of view/state