refactor variable definition