refactor the code for the "not" operator example