Router from inline to class