Added additional step to refine masks before performing the real fit