refactoring and changing variable names