Optimize by avoiding useless copies.