change value copies to references in some places