Refactor masked -> zero