clean the code up so there are no warnings
use the longest common prefix of the route