Updated router logic with init