diff --git a/openstack/orchestration/v1/stacks/environment.go b/openstack/orchestration/v1/stacks/environment.go
index 4d4779c..abaff20 100644
--- a/openstack/orchestration/v1/stacks/environment.go
+++ b/openstack/orchestration/v1/stacks/environment.go
@@ -1,32 +1,32 @@
 package stacks
 
 import (
-	"errors"
 	"fmt"
 	"strings"
 )
 
-// an interface to represent stack environments
+// Environment is a structure that represents stack environments
 type Environment struct {
 	TE
 }
 
-// allowed sections in a stack environment file
+// EnvironmentSections is a map containing allowed sections in a stack environment file
 var EnvironmentSections = map[string]bool{
 	"parameters":         true,
 	"parameter_defaults": true,
 	"resource_registry":  true,
 }
 
+// Validate validates the contents of the Environment
 func (e *Environment) Validate() error {
 	if e.Parsed == nil {
 		if err := e.Parse(); err != nil {
 			return err
 		}
 	}
-	for key, _ := range e.Parsed {
+	for key := range e.Parsed {
 		if _, ok := EnvironmentSections[key]; !ok {
-			return errors.New(fmt.Sprintf("Environment has wrong section: %s", key))
+			return fmt.Errorf("Environment has wrong section: %s", key)
 		}
 	}
 	return nil
@@ -51,14 +51,14 @@
 	switch rr.(type) {
 	// process further only if the resource registry is a map
 	case map[string]interface{}, map[interface{}]interface{}:
-		rr_map, err := toStringKeys(rr)
+		rrMap, err := toStringKeys(rr)
 		if err != nil {
 			return err
 		}
 		// the resource registry might contain a base URL for the resource. If
 		// such a field is present, use it. Otherwise, use the default base URL.
 		var baseURL string
-		if val, ok := rr_map["base_url"]; ok {
+		if val, ok := rrMap["base_url"]; ok {
 			baseURL = val.(string)
 		} else {
 			baseURL = e.baseURL
@@ -78,24 +78,24 @@
 		// check the `resources` section (if it exists) for more URL's. Note that
 		// the previous call to GetFileContents was (deliberately) not recursive
 		// as we want more control over where to look for URL's
-		if val, ok := rr_map["resources"]; ok {
+		if val, ok := rrMap["resources"]; ok {
 			switch val.(type) {
 			// process further only if the contents are a map
 			case map[string]interface{}, map[interface{}]interface{}:
-				resources_map, err := toStringKeys(val)
+				resourcesMap, err := toStringKeys(val)
 				if err != nil {
 					return err
 				}
-				for _, v := range resources_map {
+				for _, v := range resourcesMap {
 					switch v.(type) {
 					case map[string]interface{}, map[interface{}]interface{}:
-						resource_map, err := toStringKeys(v)
+						resourceMap, err := toStringKeys(v)
 						if err != nil {
 							return err
 						}
 						var resourceBaseURL string
 						// if base_url for the resource type is defined, use it
-						if val, ok := resource_map["base_url"]; ok {
+						if val, ok := resourceMap["base_url"]; ok {
 							resourceBaseURL = val.(string)
 						} else {
 							resourceBaseURL = baseURL
diff --git a/openstack/orchestration/v1/stacks/environment_test.go b/openstack/orchestration/v1/stacks/environment_test.go
index bbef283..3a3c2b9 100644
--- a/openstack/orchestration/v1/stacks/environment_test.go
+++ b/openstack/orchestration/v1/stacks/environment_test.go
@@ -76,7 +76,7 @@
 func TestGetRRFileContents(t *testing.T) {
 	th.SetupHTTP()
 	defer th.TeardownHTTP()
-	environment_content := `
+	environmentContent := `
 heat_template_version: 2013-05-23
 
 description:
@@ -100,7 +100,7 @@
       flavor: { get_param: instance_type }
       key_name: { get_param: key_name }`
 
-	db_content := `
+	dbContent := `
 heat_template_version: 2014-10-16
 
 description:
@@ -139,7 +139,7 @@
 		th.TestMethod(t, r, "GET")
 		w.Header().Set("Content-Type", "application/jason")
 		w.WriteHeader(http.StatusOK)
-		fmt.Fprintf(w, environment_content)
+		fmt.Fprintf(w, environmentContent)
 	})
 
 	fakeDBURL := strings.Join([]string{baseurl, "my_db.yaml"}, "/")
@@ -151,7 +151,7 @@
 		th.TestMethod(t, r, "GET")
 		w.Header().Set("Content-Type", "application/jason")
 		w.WriteHeader(http.StatusOK)
-		fmt.Fprintf(w, db_content)
+		fmt.Fprintf(w, dbContent)
 	})
 
 	client := fakeClient{BaseClient: getHTTPClient()}
@@ -163,14 +163,14 @@
 	th.AssertNoErr(t, err)
 	err = env.getRRFileContents(ignoreIfEnvironment)
 	th.AssertNoErr(t, err)
-	expected_env_files_content := "\nheat_template_version: 2013-05-23\n\ndescription:\n  Heat WordPress template to support F18, using only Heat OpenStack-native\n  resource types, and without the requirement for heat-cfntools in the image.\n  WordPress is web software you can use to create a beautiful website or blog.\n  This template installs a single-instance WordPress deployment using a local\n  MySQL database to store the data.\n\nparameters:\n\n  key_name:\n    type: string\n    description : Name of a KeyPair to enable SSH access to the instance\n\nresources:\n  wordpress_instance:\n    type: OS::Nova::Server\n    properties:\n      image: { get_param: image_id }\n      flavor: { get_param: instance_type }\n      key_name: { get_param: key_name }"
-	expected_db_files_content := "\nheat_template_version: 2014-10-16\n\ndescription:\n  Test template for Trove resource capabilities\n\nparameters:\n  db_pass:\n    type: string\n    hidden: true\n    description: Database access password\n    default: secrete\n\nresources:\n\nservice_db:\n  type: OS::Trove::Instance\n  properties:\n    name: trove_test_db\n    datastore_type: mariadb\n    flavor: 1GB Instance\n    size: 10\n    databases:\n    - name: test_data\n    users:\n    - name: kitchen_sink\n      password: { get_param: db_pass }\n      databases: [ test_data ]"
+	expectedEnvFilesContent := "\nheat_template_version: 2013-05-23\n\ndescription:\n  Heat WordPress template to support F18, using only Heat OpenStack-native\n  resource types, and without the requirement for heat-cfntools in the image.\n  WordPress is web software you can use to create a beautiful website or blog.\n  This template installs a single-instance WordPress deployment using a local\n  MySQL database to store the data.\n\nparameters:\n\n  key_name:\n    type: string\n    description : Name of a KeyPair to enable SSH access to the instance\n\nresources:\n  wordpress_instance:\n    type: OS::Nova::Server\n    properties:\n      image: { get_param: image_id }\n      flavor: { get_param: instance_type }\n      key_name: { get_param: key_name }"
+	expectedDBFilesContent := "\nheat_template_version: 2014-10-16\n\ndescription:\n  Test template for Trove resource capabilities\n\nparameters:\n  db_pass:\n    type: string\n    hidden: true\n    description: Database access password\n    default: secrete\n\nresources:\n\nservice_db:\n  type: OS::Trove::Instance\n  properties:\n    name: trove_test_db\n    datastore_type: mariadb\n    flavor: 1GB Instance\n    size: 10\n    databases:\n    - name: test_data\n    users:\n    - name: kitchen_sink\n      password: { get_param: db_pass }\n      databases: [ test_data ]"
 
-	th.AssertEquals(t, expected_env_files_content, env.Files[fakeEnvURL])
-	th.AssertEquals(t, expected_db_files_content, env.Files[fakeDBURL])
+	th.AssertEquals(t, expectedEnvFilesContent, env.Files[fakeEnvURL])
+	th.AssertEquals(t, expectedDBFilesContent, env.Files[fakeDBURL])
 
 	env.fixFileRefs()
-	expected_parsed := map[string]interface{}{
+	expectedParsed := map[string]interface{}{
 		"resource_registry": "2015-04-30",
 		"My::WP::Server":    fakeEnvURL,
 		"resources": map[string]interface{}{
@@ -180,5 +180,5 @@
 		},
 	}
 	env.Parse()
-	th.AssertDeepEquals(t, expected_parsed, env.Parsed)
+	th.AssertDeepEquals(t, expectedParsed, env.Parsed)
 }
diff --git a/openstack/orchestration/v1/stacks/fixtures.go b/openstack/orchestration/v1/stacks/fixtures.go
index 0cb38c2..83f5dec 100644
--- a/openstack/orchestration/v1/stacks/fixtures.go
+++ b/openstack/orchestration/v1/stacks/fixtures.go
@@ -405,6 +405,7 @@
 	})
 }
 
+// ValidJSONTemplate is a valid OpenStack Heat template in JSON format
 const ValidJSONTemplate = `
 {
   "heat_template_version": "2014-10-16",
@@ -429,6 +430,7 @@
 }
 `
 
+// ValidJSONTemplateParsed is the expected parsed version of ValidJSONTemplate
 var ValidJSONTemplateParsed = map[string]interface{}{
 	"heat_template_version": "2014-10-16",
 	"parameters": map[string]interface{}{
@@ -451,6 +453,7 @@
 	},
 }
 
+// ValidYAMLTemplate is a valid OpenStack Heat template in YAML format
 const ValidYAMLTemplate = `
 heat_template_version: 2014-10-16
 parameters:
@@ -468,6 +471,7 @@
       image: Debian 7 (Wheezy) (PVHVM)
 `
 
+// InvalidTemplateNoVersion is an invalid template as it has no `version` section
 const InvalidTemplateNoVersion = `
 parameters:
   flavor:
@@ -484,6 +488,7 @@
       image: Debian 7 (Wheezy) (PVHVM)
 `
 
+// ValidJSONEnvironment is a valid environment for a stack in JSON format
 const ValidJSONEnvironment = `
 {
   "parameters": {
@@ -519,6 +524,7 @@
 }
 `
 
+// ValidJSONEnvironmentParsed is the expected parsed version of ValidJSONEnvironment
 var ValidJSONEnvironmentParsed = map[string]interface{}{
 	"parameters": map[string]interface{}{
 		"user_key": "userkey",
@@ -552,6 +558,7 @@
 	},
 }
 
+// ValidYAMLEnvironment is a valid environment for a stack in YAML format
 const ValidYAMLEnvironment = `
 parameters:
   user_key: userkey
@@ -577,6 +584,7 @@
         hooks: [pre-create, pre-update]
 `
 
+// InvalidEnvironment is an invalid environment as it has an extra section called `resources`
 const InvalidEnvironment = `
 parameters:
   flavor:
diff --git a/openstack/orchestration/v1/stacks/template.go b/openstack/orchestration/v1/stacks/template.go
index 32fe95b..234ce49 100644
--- a/openstack/orchestration/v1/stacks/template.go
+++ b/openstack/orchestration/v1/stacks/template.go
@@ -1,35 +1,38 @@
 package stacks
 
 import (
-	"errors"
 	"fmt"
 	"github.com/rackspace/gophercloud"
 	"reflect"
 	"strings"
 )
 
+// Template is a structure that represents OpenStack Heat templates
 type Template struct {
 	TE
 }
 
+// TemplateFormatVersions is a map containing allowed variations of the template format version
+// Note that this contains the permitted variations of the _keys_ not the values.
 var TemplateFormatVersions = map[string]bool{
 	"HeatTemplateFormatVersion": true,
 	"heat_template_version":     true,
 	"AWSTemplateFormatVersion":  true,
 }
 
+// Validate validates the contents of the Template
 func (t *Template) Validate() error {
 	if t.Parsed == nil {
 		if err := t.Parse(); err != nil {
 			return err
 		}
 	}
-	for key, _ := range t.Parsed {
+	for key := range t.Parsed {
 		if _, ok := TemplateFormatVersions[key]; ok {
 			return nil
 		}
 	}
-	return errors.New(fmt.Sprintf("Template format version not found."))
+	return fmt.Errorf("Template format version not found.")
 }
 
 // GetFileContents recursively parses a template to search for urls. These urls
@@ -49,11 +52,11 @@
 	switch te.(type) {
 	// if te is a map
 	case map[string]interface{}, map[interface{}]interface{}:
-		te_map, err := toStringKeys(te)
+		teMap, err := toStringKeys(te)
 		if err != nil {
 			return err
 		}
-		for k, v := range te_map {
+		for k, v := range teMap {
 			value, ok := v.(string)
 			if !ok {
 				// if the value is not a string, recursively parse that value
@@ -101,9 +104,9 @@
 		return nil
 	// if te is a slice, call the function on each element of the slice.
 	case []interface{}:
-		te_slice := te.([]interface{})
-		for i := range te_slice {
-			if err := t.getFileContents(te_slice[i], ignoreIf, recurse); err != nil {
+		teSlice := te.([]interface{})
+		for i := range teSlice {
+			if err := t.getFileContents(teSlice[i], ignoreIf, recurse); err != nil {
 				return err
 			}
 		}
@@ -111,7 +114,7 @@
 	case string, bool, float64, nil, int:
 		return nil
 	default:
-		return errors.New(fmt.Sprintf("%v: Unrecognized type", reflect.TypeOf(te)))
+		return fmt.Errorf("%v: Unrecognized type", reflect.TypeOf(te))
 
 	}
 	return nil
diff --git a/openstack/orchestration/v1/stacks/template_test.go b/openstack/orchestration/v1/stacks/template_test.go
index a297f77..6884db8 100644
--- a/openstack/orchestration/v1/stacks/template_test.go
+++ b/openstack/orchestration/v1/stacks/template_test.go
@@ -81,7 +81,7 @@
 	fakeURL := strings.Join([]string{baseurl, "my_nova.yaml"}, "/")
 	urlparsed, err := url.Parse(fakeURL)
 	th.AssertNoErr(t, err)
-	my_nova_content := `heat_template_version: 2014-10-16
+	myNovaContent := `heat_template_version: 2014-10-16
 parameters:
   flavor:
     type: string
@@ -101,7 +101,7 @@
 		th.TestMethod(t, r, "GET")
 		w.Header().Set("Content-Type", "application/jason")
 		w.WriteHeader(http.StatusOK)
-		fmt.Fprintf(w, my_nova_content)
+		fmt.Fprintf(w, myNovaContent)
 	})
 
 	client := fakeClient{BaseClient: getHTTPClient()}
@@ -116,7 +116,7 @@
 	th.AssertNoErr(t, err)
 	err = te.getFileContents(te.Parsed, ignoreIfTemplate, true)
 	th.AssertNoErr(t, err)
-	expected_files := map[string]string{
+	expectedFiles := map[string]string{
 		"my_nova.yaml": `heat_template_version: 2014-10-16
 parameters:
   flavor:
@@ -133,9 +133,9 @@
       image: Debian 7 (Wheezy) (PVHVM)
       networks:
       - {uuid: 11111111-1111-1111-1111-111111111111}`}
-	th.AssertEquals(t, expected_files["my_nova.yaml"], te.Files[fakeURL])
+	th.AssertEquals(t, expectedFiles["my_nova.yaml"], te.Files[fakeURL])
 	te.fixFileRefs()
-	expected_parsed := map[string]interface{}{
+	expectedParsed := map[string]interface{}{
 		"heat_template_version": "2015-04-30",
 		"resources": map[string]interface{}{
 			"my_server": map[string]interface{}{
@@ -144,5 +144,5 @@
 		},
 	}
 	te.Parse()
-	th.AssertDeepEquals(t, expected_parsed, te.Parsed)
+	th.AssertDeepEquals(t, expectedParsed, te.Parsed)
 }
diff --git a/openstack/orchestration/v1/stacks/utils.go b/openstack/orchestration/v1/stacks/utils.go
index 420a7fa..7b476a9 100644
--- a/openstack/orchestration/v1/stacks/utils.go
+++ b/openstack/orchestration/v1/stacks/utils.go
@@ -2,7 +2,6 @@
 
 import (
 	"encoding/json"
-	"errors"
 	"fmt"
 	"io/ioutil"
 	"net/http"
@@ -21,7 +20,7 @@
 	Get(string) (*http.Response, error)
 }
 
-// Base structure for both Template and Environment
+// TE is a base structure for both Template and Environment
 type TE struct {
 	// Bin stores the contents of the template or environment.
 	Bin []byte
@@ -59,7 +58,7 @@
 		return nil
 	}
 
-	// get a fqdn from the URL using the baseURL of the template. For local files,
+	// get a fqdn from the URL using the baseURL of the TE. For local files,
 	// the URL's will have the `file` scheme.
 	u, err := gophercloud.NormalizePathURL(t.baseURL, t.URL)
 	if err != nil {
@@ -72,7 +71,7 @@
 		t.client = getHTTPClient()
 	}
 
-	// use the client to fetch the contents of the template
+	// use the client to fetch the contents of the TE
 	resp, err := t.client.Get(t.URL)
 	if err != nil {
 		return err
@@ -86,7 +85,7 @@
 	return nil
 }
 
-// get the basepath of the template.
+// get the basepath of the TE
 func getBasePath() (string, error) {
 	basePath, err := filepath.Abs(".")
 	if err != nil {
@@ -100,7 +99,7 @@
 }
 
 // get a an HTTP client to retrieve URL's. This client allows the use of `file`
-// scheme since we may need to fetch templates from users filesystem
+// scheme since we may need to fetch files from users filesystem
 func getHTTPClient() Client {
 	transport := &http.Transport{}
 	transport.RegisterProtocol("file", http.NewFileTransport(http.Dir("/")))
@@ -114,49 +113,49 @@
 	}
 	if jerr := json.Unmarshal(t.Bin, &t.Parsed); jerr != nil {
 		if yerr := yaml.Unmarshal(t.Bin, &t.Parsed); yerr != nil {
-			return errors.New(fmt.Sprintf("Data in neither json nor yaml format."))
+			return fmt.Errorf("Data in neither json nor yaml format.")
 		}
 	}
 	return t.Validate()
 }
 
-// base Validate method, always returns nil
+// Validate validates the contents of TE
 func (t *TE) Validate() error {
 	return nil
 }
 
 // igfunc is a parameter used by GetFileContents and GetRRFileContents to check
-// for valid template URL's.
+// for valid URL's.
 type igFunc func(string, interface{}) bool
 
 // convert map[interface{}]interface{} to map[string]interface{}
 func toStringKeys(m interface{}) (map[string]interface{}, error) {
 	switch m.(type) {
 	case map[string]interface{}, map[interface{}]interface{}:
-		typed_map := make(map[string]interface{})
+		typedMap := make(map[string]interface{})
 		if _, ok := m.(map[interface{}]interface{}); ok {
 			for k, v := range m.(map[interface{}]interface{}) {
-				typed_map[k.(string)] = v
+				typedMap[k.(string)] = v
 			}
 		} else {
-			typed_map = m.(map[string]interface{})
+			typedMap = m.(map[string]interface{})
 		}
-		return typed_map, nil
+		return typedMap, nil
 	default:
-		return nil, errors.New(fmt.Sprintf("Expected a map of type map[string]interface{} or map[interface{}]interface{}, actual type: %v", reflect.TypeOf(m)))
+		return nil, fmt.Errorf("Expected a map of type map[string]interface{} or map[interface{}]interface{}, actual type: %v", reflect.TypeOf(m))
 
 	}
 }
 
-// fix the template reference to files by replacing relative URL's by absolute
+// fix the reference to files by replacing relative URL's by absolute
 // URL's
 func (t *TE) fixFileRefs() {
-	t_str := string(t.Bin)
+	tStr := string(t.Bin)
 	if t.fileMaps == nil {
 		return
 	}
 	for k, v := range t.fileMaps {
-		t_str = strings.Replace(t_str, k, v, -1)
+		tStr = strings.Replace(tStr, k, v, -1)
 	}
-	t.Bin = []byte(t_str)
+	t.Bin = []byte(tStr)
 }
diff --git a/openstack/orchestration/v1/stacks/utils_test.go b/openstack/orchestration/v1/stacks/utils_test.go
index 6a3c5c0..2536e03 100644
--- a/openstack/orchestration/v1/stacks/utils_test.go
+++ b/openstack/orchestration/v1/stacks/utils_test.go
@@ -22,18 +22,18 @@
 }
 
 func TesttoStringKeys(t *testing.T) {
-	var test_1 interface{} = map[interface{}]interface{}{
+	var test1 interface{} = map[interface{}]interface{}{
 		"Adam":  "Smith",
 		"Isaac": "Newton",
 	}
-	result_1, err := toStringKeys(test_1)
+	result1, err := toStringKeys(test1)
 	th.AssertNoErr(t, err)
 
 	expected := map[string]interface{}{
 		"Adam":  "Smith",
 		"Isaac": "Newton",
 	}
-	th.AssertDeepEquals(t, result_1, expected)
+	th.AssertDeepEquals(t, result1, expected)
 }
 
 func TestGetBasePath(t *testing.T) {
