move mask_state_below out