Cleaning mask extraction script file