Alot of this logic is copy / paste from the RoutingBundle, I think we should try find a way to reduce the duplication..