fix some references
several improvements