improve encapsulation of view construction