Rename functions and create local variables