Overdue tidying of attack function