clean code to remove improper messages