refactor to local variable