Changed behaviour of path, uri and router.

- with cleanup of code