Added a router, moved init function