use a constructor and prototype for 'class definition'