restructuring of view/controller so that controller now creates view