Remove unnecessary vars and funcs