Refining masks