Renaming variables and put unused tests in an if statement