Removes unnecessary pointers