Refactoring attack logic