remove unused vars and funcs