Remove some unnecessary copies