View Separation in to a constructor function