Restructure metacognition plugin