The bombing attack that injured 29 civilians in the Chelsea neighborhood of Manhattan last month serves as a grave reminder of the constant threat posed to major cities by violent extremism. In addition to the improvised device used in that attack, three other sets of explosives were discovered in the greater New York City area this weekend, all allegedly planted by the same terrorist operative, Ahmad Khan Rahami. Rahami, 28, has been an American citizen since 2011 and is said to have only been radicalized over the past two years. So, how can the American national security apparatus protect its urban centers from attacks that are being perpetrated by homegrown or lone wolf terrorists, rather than longstanding groups of foreign non-state actors, with increasing frequency?

The solutions, derived from the recommendations of federal agencies and independent contractors, as well as common sense, can be broken down into two main categories: improving processes of identifying would-be attackers, and securing our cities through visible deterrents and hidden protection mechanisms. The first responsibility falls largely on the American intelligence community, a group of 16 government agencies including the CIA, the NSA, and the FBI’s Intelligence Branch that are collectively responsible for procuring and analyzing information relevant to the security of our country. The IC generally uses communications surveillance, international intelligence pooling, facial recognition software and predictive analytics to identify people with terrorist connections or who fit the profile of a potential terrorist. Moving forward, these agencies should modernize their information-sharing processes so that all IC organizations and local law enforcement entities can be on the same page. That way, reports of suspected terrorist activity will not be noted in one state but fly under the radar in another, where that information might help eliminate a threat. Experts have recommended the creation of interagency field offices at major metropolitan police departments and a keyword “ping” system, in which information pertinent to, say, Los Angeles is automatically directed to the relevant local authorities upon receipt by another agency.

In light of the changing organizational dynamic of terror groups and new restrictions on government monitoring, however, the IC has in many cases adjusted its programs to address individual radicalization more than the formation of numerous terrorist cells. Now more than ever, extremist groups are using social media to add new members to their ranks, and the IC has made purging these sites of terrorist propaganda a priority. To achieve their goal, intelligence officers have enlisted social media giants like Twitter to police their own domain. Over the next few years, users can expect increased monitoring to prevent the dissemination of terrorist materials such as bomb-making manuals and instructions for incurring high numbers of casualties in attacks, as well as videos or texts promoting extremism, such as those propagated by the followers of the radical Islamic cleric Anwar al-Awlaki.

The duty of physically securing major cities falls equally upon federal and municipal governments. At the national level, the government is responsible for providing security for all airports, in addition to intelligence distribution services and adequate funding for most critical infrastructure. Failures in these departments are common, and deeply troubling; in a TSA-commissioned study designed to test the strength of airport security in the United States, for example, nearly 96% of banned items (explosives, firearms and other forms of contraband) made it onto planes. Infrastructure in this country has been deteriorating for years, and a well-planned attack at a vulnerable site – say, the East River Tunnels that serve Amtrak in New York – could, according to the Blue Ribbon Panel on Bridge and Tunnel Security, “result in hundreds or thousands of casualties, billions of dollars worth of direct reconstruction costs, and even greater socioeconomic costs.” And in countless cases, including the Boston Marathon bombing and the recent Chelsea attack, the FBI and other agencies failed to take action against or to alert local authorities to the presence of suspected terrorists.

Improvement in these areas will be expensive and time-consuming, but crucial. On the infrastructure front, Congress and the National Highway Administration will need to work with state and local governments to improve existing roads, bridges and tunnels and build alternative structures that could alleviate the severity of an attack on American transportation routes. In addition, all highways, toll booths, bridges, and tunnels should be outfitted over the next decade with more advanced security checkpoints – of the sort that are already present in our nation’s busiest ports. These stations as they exist today are comprised of x-ray scanners, sniffer dog teams, emergency response units and other law enforcement mechanisms. Functions of the checkpoints include radiation and explosives detection, attack deterrence, the prevention of narcotics and firearm trafficking, and increased first responder readiness. To ensure the adequacy of these important measures, municipal governments should be responsible for conducting frequent risk assessments at local “choke points,” where commercial and private traffic is especially heavy.

Airports are a special case. Though the damning results of the Homeland Security study reflect serious flaws in our aviation security system, airports are generally considered well-protected. To truly become impenetrable, the FAA and TSA should increase personnel and explore methods of expediting the conduction of more thorough bag scans. At present, in-depth CT scans that produce tomographic records of mass, density and material are generally eschewed in favor of less sophisticated, quicker scans to avoid increasing already prolonged wait times. If these practices continue, chances are a well-hidden explosive or other offensive device may make it onto an aircraft. Likewise, in light of the recent Brussels and Istanbul airport bombings, it has become necessary to invest in stronger outer perimeter fortifications of the kind that are already in place at major shipping ports, that can detect ordnance and prevent it from being delivered to crowded airport terminals.

Local police forces are equally capable of improving a city’s chances of preventing or responding to a terrorist attack. Chiefs have generally been hesitant to send dogs to accompany foot patrols, but that may well be a necessary step toward preventing attacks like the Chelsea bombing, in which the alleged perpetrator placed improvised explosives devices in a construction dumpster. Demonstrations of police presence and strength have been shown to deter crime effectively, and the same principle applies to terror. Subway security must also be improved to avoid situations such as that which occurred at the Maelbeck train station in March, when 20 people were killed and countless more injured in an ISIS bombing. All metro stops in the United States should have police officers on duty during peak hours, in addition to dogs and mobile explosive ordnance disposal systems at especially busy stations such as Times Square or Dupont Circle. Also, per multiple independent analyses of the vulnerabilities of major cities, in the future turnstiles and entry doors can outfitted with weapons detection mechanisms, like the basic walk-through metal detectors used at athletic events. With even a few of these visible suggestions in place, would-be attackers would face strong deterrents against committing acts of terror, and residents of urban areas would feel safer.

City planners play a vital role in the fight against violent extremism. Through the use of bollards – dense, heavy blocks of metal or other strong materials that prevent vehicles from traveling through restricted areas – cities can prevent attacks like that which occurred in Nice over the summer, when a truck driver plowed through a large crowd and murdered 70 civilians. These defenses are highly effective and are already in place at high-priority American buildings and landmarks throughout the country. Designers can use them dually as protection mechanisms, flowerpots or works of art to integrate them into everyday life; there is even a popular Instagram series dedicated to protective bollards in urban America. Placing bollards around major pedestrian plazas and other sites known to have heavy foot traffic would prevent ram attacks, like the Nice strike, and would greatly reduce the effectiveness of a car or truck bombing, due to the decreased proximity of the explosives to their target. Similarly, building codes can be updated to reflect not just environmental concerns but also security and stability. Standards for structural integrity can be increased, to lessen the likelihood of building collapse, and damage-resistant materials can be used to reduce the toll of attacks that might shatter glass or destroy weaker building components. Finally, according to security experts, buildings can be designed to minimize the number of casualties in active shooter scenarios. This can be accomplished through the use of interior locks, centralized security systems that control all doors and elevators, the dispersal of personnel throughout building grounds, and other methods, as outlined by the National Institute of Building Sciences.

In the end, we know that terrorists will continue to attempt to harm and intimidate innocent civilians throughout the world. That is out of our control; what we can do is take as many precautions as possible to reduce the probability of a successful attack and prepare for its aftermath. Doing so involves cooperation on a number of levels, including the military and the federal government, state and local authorities, and of course, an active and aware citizenry. If even a few of the steps outlined here are adopted in the next few years, our country and world will become much more secure than it is now.