Mask functions.