refactoring of setting an attack type