various refactoring

The effect of this, mainly, is a bit of cleanup/simplification of the view related code.