refactor attacker, remove useless code