diff --git a/android/module.go b/android/module.go
index 39f5ff9..450dba9 100644
--- a/android/module.go
+++ b/android/module.go
@@ -35,10 +35,6 @@
 var (
 	DeviceSharedLibrary = "shared_library"
 	DeviceStaticLibrary = "static_library"
-	DeviceExecutable    = "executable"
-	HostSharedLibrary   = "host_shared_library"
-	HostStaticLibrary   = "host_static_library"
-	HostExecutable      = "host_executable"
 )
 
 type BuildParams struct {
@@ -980,8 +976,8 @@
 }
 
 func MakeDefaultDistFiles(paths ...Path) TaggedDistFiles {
-	for _, path := range paths {
-		if path == nil {
+	for _, p := range paths {
+		if p == nil {
 			panic("The path to a dist file cannot be nil.")
 		}
 	}
@@ -1005,7 +1001,6 @@
 	MultilibFirst       Multilib = "first"
 	MultilibCommon      Multilib = "common"
 	MultilibCommonFirst Multilib = "common_first"
-	MultilibDefault     Multilib = ""
 )
 
 type HostOrDeviceSupported int
@@ -1149,23 +1144,17 @@
 
 func (attrs *CommonAttributes) fillCommonBp2BuildModuleAttrs(ctx *topDownMutatorContext,
 	enabledPropertyOverrides bazel.BoolAttribute) constraintAttributes {
-	// Assert passed-in attributes include Name
-	name := attrs.Name
-	if len(name) == 0 {
-		ctx.ModuleErrorf("CommonAttributes in fillCommonBp2BuildModuleAttrs expects a `.Name`!")
-	}
 
 	mod := ctx.Module().base()
-	props := &mod.commonProperties
+	// Assert passed-in attributes include Name
+	if len(attrs.Name) == 0 {
+		ctx.ModuleErrorf("CommonAttributes in fillCommonBp2BuildModuleAttrs expects a `.Name`!")
+	}
 
 	depsToLabelList := func(deps []string) bazel.LabelListAttribute {
 		return bazel.MakeLabelListAttribute(BazelLabelForModuleDeps(ctx, deps))
 	}
 
-	data := &attrs.Data
-
-	archVariantProps := mod.GetArchVariantProperties(ctx, &commonProperties{})
-
 	var enabledProperty bazel.BoolAttribute
 
 	onlyAndroid := false
@@ -1193,11 +1182,11 @@
 			neitherHostNorDevice = true
 		}
 
-		for _, os := range OsTypeList() {
-			if os.Class == Host {
-				osSupport[os.Name] = moduleSupportsHost
-			} else if os.Class == Device {
-				osSupport[os.Name] = moduleSupportsDevice
+		for _, osType := range OsTypeList() {
+			if osType.Class == Host {
+				osSupport[osType.Name] = moduleSupportsHost
+			} else if osType.Class == Device {
+				osSupport[osType.Name] = moduleSupportsDevice
 			}
 		}
 	}
@@ -1205,25 +1194,26 @@
 	if neitherHostNorDevice {
 		// we can't build this, disable
 		enabledProperty.Value = proptools.BoolPtr(false)
-	} else if props.Enabled != nil {
-		enabledProperty.SetValue(props.Enabled)
-		if !*props.Enabled {
-			for os, enabled := range osSupport {
-				if val := enabledProperty.SelectValue(bazel.OsConfigurationAxis, os); enabled && val != nil && *val {
+	} else if mod.commonProperties.Enabled != nil {
+		enabledProperty.SetValue(mod.commonProperties.Enabled)
+		if !*mod.commonProperties.Enabled {
+			for oss, enabled := range osSupport {
+				if val := enabledProperty.SelectValue(bazel.OsConfigurationAxis, oss); enabled && val != nil && *val {
 					// if this should be disabled by default, clear out any enabling we've done
-					enabledProperty.SetSelectValue(bazel.OsConfigurationAxis, os, nil)
+					enabledProperty.SetSelectValue(bazel.OsConfigurationAxis, oss, nil)
 				}
 			}
 		}
 	}
 
-	required := depsToLabelList(props.Required)
+	required := depsToLabelList(mod.commonProperties.Required)
+	archVariantProps := mod.GetArchVariantProperties(ctx, &commonProperties{})
 	for axis, configToProps := range archVariantProps {
 		for config, _props := range configToProps {
 			if archProps, ok := _props.(*commonProperties); ok {
 				// TODO(b/234748998) Remove this requiredFiltered workaround when aapt2 converts successfully
 				requiredFiltered := archProps.Required
-				if name == "apexer" {
+				if attrs.Name == "apexer" {
 					requiredFiltered = make([]string, 0, len(archProps.Required))
 					for _, req := range archProps.Required {
 						if req != "aapt2" && req != "apexer" {
@@ -1278,7 +1268,7 @@
 	})
 
 	platformEnabledAttribute, err := enabledProperty.ToLabelListAttribute(
-		bazel.LabelList{[]bazel.Label{bazel.Label{Label: "@platforms//:incompatible"}}, nil},
+		bazel.LabelList{[]bazel.Label{{Label: "@platforms//:incompatible"}}, nil},
 		bazel.LabelList{[]bazel.Label{}, nil})
 	if err != nil {
 		ctx.ModuleErrorf("Error processing platform enabled attribute: %s", err)
@@ -1291,15 +1281,13 @@
 		platformEnabledAttribute.Add(&l)
 	}
 
-	data.Append(required)
+	attrs.Data.Append(required)
 
-	constraints := constraintAttributes{}
 	moduleEnableConstraints := bazel.LabelListAttribute{}
 	moduleEnableConstraints.Append(platformEnabledAttribute)
 	moduleEnableConstraints.Append(productConfigEnabledAttribute)
-	constraints.Target_compatible_with = moduleEnableConstraints
 
-	return constraints
+	return constraintAttributes{Target_compatible_with: moduleEnableConstraints}
 }
 
 // Check product variables for `enabled: true` flag override.
@@ -1642,7 +1630,7 @@
 	// transformSourceToObj, and should only affects unit tests.
 	vars := m.VariablesForTests()
 	buildParams := append([]BuildParams(nil), m.buildParams...)
-	for i, _ := range buildParams {
+	for i := range buildParams {
 		newArgs := make(map[string]string)
 		for k, v := range buildParams[i].Args {
 			newArgs[k] = v
@@ -2287,7 +2275,7 @@
 
 	// Some common property checks for properties that will be used later in androidmk.go
 	checkDistProperties(ctx, "dist", &m.distProperties.Dist)
-	for i, _ := range m.distProperties.Dists {
+	for i := range m.distProperties.Dists {
 		checkDistProperties(ctx, fmt.Sprintf("dists[%d]", i), &m.distProperties.Dists[i])
 	}
 
@@ -3465,14 +3453,6 @@
 	return sourceOrOutputDependencyTag{moduleName: moduleName, tag: tag}
 }
 
-// IsSourceDepTag returns true if the supplied blueprint.DependencyTag is one that was used to add
-// dependencies by either ExtractSourceDeps, ExtractSourcesDeps or automatically for properties
-// tagged with `android:"path"`.
-func IsSourceDepTag(depTag blueprint.DependencyTag) bool {
-	_, ok := depTag.(sourceOrOutputDependencyTag)
-	return ok
-}
-
 // IsSourceDepTagWithOutputTag returns true if the supplied blueprint.DependencyTag is one that was
 // used to add dependencies by either ExtractSourceDeps, ExtractSourcesDeps or automatically for
 // properties tagged with `android:"path"` AND it was added using a module reference of
@@ -3599,14 +3579,14 @@
 // be tagged with `android:"path" to support automatic source module dependency resolution.
 //
 // Deprecated: use PathForModuleSrc instead.
-func (m *moduleContext) ExpandSource(srcFile, prop string) Path {
+func (m *moduleContext) ExpandSource(srcFile, _ string) Path {
 	return PathForModuleSrc(m, srcFile)
 }
 
 // Returns an optional single path expanded from globs and modules referenced using ":module" syntax if
 // the srcFile is non-nil.  The property must be tagged with `android:"path" to support automatic source module
 // dependency resolution.
-func (m *moduleContext) ExpandOptionalSource(srcFile *string, prop string) OptionalPath {
+func (m *moduleContext) ExpandOptionalSource(srcFile *string, _ string) OptionalPath {
 	if srcFile != nil {
 		return OptionalPathForPath(PathForModuleSrc(m, *srcFile))
 	}
