Cognitive mechanisms in violent extremism