remove duplicated code
remove dead code
handle the invalid case while initializing symbol table