Cleanup (remove obsolete funcs and vars)