Models of leader elections and their applications