refactor local variable