Update again

DmgFilter is local
Refactored function name
DmgFilter is created once from file scope now.