Refactored NetFilter into a variable guarded by netLock