Updated router code