Renameing functions and refactoring the attack