removes unnecessary links and routes