Refactor variable declarations