Client side: replaced anonymous blocks to lambda