Tidy up DeclareVar codegen