Mechanism of action of chlorthalidone is: