Move lots of view code to the base class