Add a dynamic routing
Some refactoring