Removed copy_if and unneeded consts