fix subscript
handle :defs
rename things
remove useless code