59414330 refactor the routing key method

and also fixed some specs.