remove locals for non-recursive functions