Refactor variable definitions