remove duplicate var and fix note extraction