Reorganize and simplify local variables.