abstracted out main view