changed singleton to static ref to remove need for destructor