Improved logging and cleaned the filter