Why rpc function is a method of session struct, apparently it's completely independent from the session instance it's called from.