Refactor routerComponent and add routerLayout