some renaming and variable moves