Refactored code to name put as filterMessage