Added support routing. Some refactoring.