improve session key extraction