refactoring: creating local variables