moved view logic out of VC