Small refactoring of variable access code generation