Putting components into a session in a more typesafe manner