Renaming varibles and code refactoring