diff --git a/openstack/orchestration/v1/apiversions/results.go b/openstack/orchestration/v1/apiversions/results.go
index 0373ccc..a7c22a2 100644
--- a/openstack/orchestration/v1/apiversions/results.go
+++ b/openstack/orchestration/v1/apiversions/results.go
@@ -1,7 +1,6 @@
 package apiversions
 
 import (
-	"github.com/mitchellh/mapstructure"
 	"github.com/gophercloud/gophercloud"
 	"github.com/gophercloud/gophercloud/pagination"
 )
@@ -9,9 +8,9 @@
 // APIVersion represents an API version for Neutron. It contains the status of
 // the API, and its unique ID.
 type APIVersion struct {
-	Status string             `mapstructure:"status"`
-	ID     string             `mapstructure:"id"`
-	Links  []gophercloud.Link `mapstructure:"links"`
+	Status string             `json:"status"`
+	ID     string             `json:"id"`
+	Links  []gophercloud.Link `json:"links"`
 }
 
 // APIVersionPage is the page returned by a pager when traversing over a
@@ -23,20 +22,15 @@
 // IsEmpty checks whether an APIVersionPage struct is empty.
 func (r APIVersionPage) IsEmpty() (bool, error) {
 	is, err := ExtractAPIVersions(r)
-	if err != nil {
-		return true, err
-	}
-	return len(is) == 0, nil
+	return len(is) == 0, err
 }
 
 // ExtractAPIVersions takes a collection page, extracts all of the elements,
 // and returns them a slice of APIVersion structs. It is effectively a cast.
-func ExtractAPIVersions(page pagination.Page) ([]APIVersion, error) {
-	var resp struct {
-		Versions []APIVersion `mapstructure:"versions"`
+func ExtractAPIVersions(r pagination.Page) ([]APIVersion, error) {
+	var s struct {
+		APIVersions []APIVersion `json:"versions"`
 	}
-
-	err := mapstructure.Decode(page.(APIVersionPage).Body, &resp)
-
-	return resp.Versions, err
+	err := (r.(APIVersionPage)).ExtractInto(&s)
+	return s.APIVersions, err
 }
diff --git a/openstack/orchestration/v1/buildinfo/results.go b/openstack/orchestration/v1/buildinfo/results.go
index fe655a3..c3d2cdb 100644
--- a/openstack/orchestration/v1/buildinfo/results.go
+++ b/openstack/orchestration/v1/buildinfo/results.go
@@ -1,19 +1,18 @@
 package buildinfo
 
 import (
-	"github.com/mitchellh/mapstructure"
 	"github.com/gophercloud/gophercloud"
 )
 
 // Revision represents the API/Engine revision of a Heat deployment.
 type Revision struct {
-	Revision string `mapstructure:"revision"`
+	Revision string `json:"revision"`
 }
 
 // BuildInfo represents the build information for a Heat deployment.
 type BuildInfo struct {
-	API    Revision `mapstructure:"api"`
-	Engine Revision `mapstructure:"engine"`
+	API    Revision `json:"api"`
+	Engine Revision `json:"engine"`
 }
 
 // GetResult represents the result of a Get operation.
@@ -24,14 +23,7 @@
 // Extract returns a pointer to a BuildInfo object and is called after a
 // Get operation.
 func (r GetResult) Extract() (*BuildInfo, error) {
-	if r.Err != nil {
-		return nil, r.Err
-	}
-
-	var res BuildInfo
-	if err := mapstructure.Decode(r.Body, &res); err != nil {
-		return nil, err
-	}
-
-	return &res, nil
+	var s *BuildInfo
+	err := r.ExtractInto(&s)
+	return s, err
 }
diff --git a/openstack/orchestration/v1/stackevents/fixtures.go b/openstack/orchestration/v1/stackevents/fixtures.go
index b6ac274..48524e5 100644
--- a/openstack/orchestration/v1/stackevents/fixtures.go
+++ b/openstack/orchestration/v1/stackevents/fixtures.go
@@ -15,7 +15,7 @@
 var FindExpected = []Event{
 	Event{
 		ResourceName: "hello_world",
-		Time:         time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC),
+		Time:         gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC)),
 		Links: []gophercloud.Link{
 			gophercloud.Link{
 				Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/06feb26f-9298-4a9b-8749-9d770e5d577a",
@@ -38,7 +38,7 @@
 	},
 	Event{
 		ResourceName: "hello_world",
-		Time:         time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC),
+		Time:         gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC)),
 		Links: []gophercloud.Link{
 			gophercloud.Link{
 				Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18",
@@ -132,7 +132,7 @@
 var ListExpected = []Event{
 	Event{
 		ResourceName: "hello_world",
-		Time:         time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC),
+		Time:         gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC)),
 		Links: []gophercloud.Link{
 			gophercloud.Link{
 				Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/06feb26f-9298-4a9b-8749-9d770e5d577a",
@@ -155,7 +155,7 @@
 	},
 	Event{
 		ResourceName: "hello_world",
-		Time:         time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC),
+		Time:         gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC)),
 		Links: []gophercloud.Link{
 			gophercloud.Link{
 				Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18",
@@ -257,7 +257,7 @@
 var ListResourceEventsExpected = []Event{
 	Event{
 		ResourceName: "hello_world",
-		Time:         time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC),
+		Time:         gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC)),
 		Links: []gophercloud.Link{
 			gophercloud.Link{
 				Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/06feb26f-9298-4a9b-8749-9d770e5d577a",
@@ -280,7 +280,7 @@
 	},
 	Event{
 		ResourceName: "hello_world",
-		Time:         time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC),
+		Time:         gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC)),
 		Links: []gophercloud.Link{
 			gophercloud.Link{
 				Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18",
@@ -381,7 +381,7 @@
 // GetExpected represents the expected object from a Get request.
 var GetExpected = &Event{
 	ResourceName: "hello_world",
-	Time:         time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC),
+	Time:         gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC)),
 	Links: []gophercloud.Link{
 		gophercloud.Link{
 			Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18",
diff --git a/openstack/orchestration/v1/stackevents/results.go b/openstack/orchestration/v1/stackevents/results.go
index ac94bb5..6c7f183 100644
--- a/openstack/orchestration/v1/stackevents/results.go
+++ b/openstack/orchestration/v1/stackevents/results.go
@@ -1,11 +1,6 @@
 package stackevents
 
 import (
-	"fmt"
-	"reflect"
-	"time"
-
-	"github.com/mitchellh/mapstructure"
 	"github.com/gophercloud/gophercloud"
 	"github.com/gophercloud/gophercloud/pagination"
 )
@@ -13,23 +8,23 @@
 // Event represents a stack event.
 type Event struct {
 	// The name of the resource for which the event occurred.
-	ResourceName string `mapstructure:"resource_name"`
+	ResourceName string `json:"resource_name"`
 	// The time the event occurred.
-	Time time.Time `mapstructure:"-"`
+	Time gophercloud.JSONRFC3339NoZ `json:"event_time"`
 	// The URLs to the event.
-	Links []gophercloud.Link `mapstructure:"links"`
+	Links []gophercloud.Link `json:"links"`
 	// The logical ID of the stack resource.
-	LogicalResourceID string `mapstructure:"logical_resource_id"`
+	LogicalResourceID string `json:"logical_resource_id"`
 	// The reason of the status of the event.
-	ResourceStatusReason string `mapstructure:"resource_status_reason"`
+	ResourceStatusReason string `json:"resource_status_reason"`
 	// The status of the event.
-	ResourceStatus string `mapstructure:"resource_status"`
+	ResourceStatus string `json:"resource_status"`
 	// The physical ID of the stack resource.
-	PhysicalResourceID string `mapstructure:"physical_resource_id"`
+	PhysicalResourceID string `json:"physical_resource_id"`
 	// The event ID.
-	ID string `mapstructure:"id"`
+	ID string `json:"id"`
 	// Properties of the stack resource.
-	ResourceProperties map[string]interface{} `mapstructure:"resource_properties"`
+	ResourceProperties map[string]interface{} `json:"resource_properties"`
 }
 
 // FindResult represents the result of a Find operation.
@@ -40,32 +35,11 @@
 // Extract returns a slice of Event objects and is called after a
 // Find operation.
 func (r FindResult) Extract() ([]Event, error) {
-	if r.Err != nil {
-		return nil, r.Err
+	var s struct {
+		Events []Event `json:"events"`
 	}
-
-	var res struct {
-		Res []Event `mapstructure:"events"`
-	}
-
-	if err := mapstructure.Decode(r.Body, &res); err != nil {
-		return nil, err
-	}
-
-	events := r.Body.(map[string]interface{})["events"].([]interface{})
-
-	for i, eventRaw := range events {
-		event := eventRaw.(map[string]interface{})
-		if date, ok := event["event_time"]; ok && date != nil {
-			t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-			if err != nil {
-				return nil, err
-			}
-			res.Res[i].Time = t
-		}
-	}
-
-	return res.Res, nil
+	err := r.ExtractInto(&s)
+	return s.Events, err
 }
 
 // EventPage abstracts the raw results of making a List() request against the API.
@@ -78,10 +52,7 @@
 // IsEmpty returns true if a page contains no Server results.
 func (r EventPage) IsEmpty() (bool, error) {
 	events, err := ExtractEvents(r)
-	if err != nil {
-		return true, err
-	}
-	return len(events) == 0, nil
+	return len(events) == 0, err
 }
 
 // LastMarker returns the last stack ID in a ListResult.
@@ -97,39 +68,12 @@
 }
 
 // ExtractEvents interprets the results of a single page from a List() call, producing a slice of Event entities.
-func ExtractEvents(page pagination.Page) ([]Event, error) {
-	casted := page.(EventPage).Body
-
-	var res struct {
-		Res []Event `mapstructure:"events"`
+func ExtractEvents(r pagination.Page) ([]Event, error) {
+	var s struct {
+		Events []Event `json:"events"`
 	}
-
-	if err := mapstructure.Decode(casted, &res); err != nil {
-		return nil, err
-	}
-
-	var events []interface{}
-	switch casted.(type) {
-	case map[string]interface{}:
-		events = casted.(map[string]interface{})["events"].([]interface{})
-	case map[string][]interface{}:
-		events = casted.(map[string][]interface{})["events"]
-	default:
-		return res.Res, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted))
-	}
-
-	for i, eventRaw := range events {
-		event := eventRaw.(map[string]interface{})
-		if date, ok := event["event_time"]; ok && date != nil {
-			t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-			if err != nil {
-				return nil, err
-			}
-			res.Res[i].Time = t
-		}
-	}
-
-	return res.Res, nil
+	err := (r.(EventPage)).ExtractInto(&s)
+	return s.Events, err
 }
 
 // ExtractResourceEvents interprets the results of a single page from a
@@ -146,27 +90,9 @@
 // Extract returns a pointer to an Event object and is called after a
 // Get operation.
 func (r GetResult) Extract() (*Event, error) {
-	if r.Err != nil {
-		return nil, r.Err
+	var s struct {
+		Event *Event `json:"event"`
 	}
-
-	var res struct {
-		Res *Event `mapstructure:"event"`
-	}
-
-	if err := mapstructure.Decode(r.Body, &res); err != nil {
-		return nil, err
-	}
-
-	event := r.Body.(map[string]interface{})["event"].(map[string]interface{})
-
-	if date, ok := event["event_time"]; ok && date != nil {
-		t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-		if err != nil {
-			return nil, err
-		}
-		res.Res.Time = t
-	}
-
-	return res.Res, nil
+	err := r.ExtractInto(&s)
+	return s.Event, err
 }
diff --git a/openstack/orchestration/v1/stackresources/fixtures.go b/openstack/orchestration/v1/stackresources/fixtures.go
index cdf1f3c..a622f7f 100644
--- a/openstack/orchestration/v1/stackresources/fixtures.go
+++ b/openstack/orchestration/v1/stackresources/fixtures.go
@@ -27,8 +27,8 @@
 		},
 		LogicalID:    "hello_world",
 		StatusReason: "state changed",
-		UpdatedTime:  time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC),
-		CreationTime: time.Date(2015, 2, 5, 21, 33, 10, 0, time.UTC),
+		UpdatedTime:  gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC)),
+		CreationTime: gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 5, 21, 33, 10, 0, time.UTC)),
 		RequiredBy:   []interface{}{},
 		Status:       "CREATE_IN_PROGRESS",
 		PhysicalID:   "49181cd6-169a-4130-9455-31185bbfc5bf",
@@ -98,8 +98,8 @@
 		},
 		LogicalID:    "hello_world",
 		StatusReason: "state changed",
-		UpdatedTime:  time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC),
-		CreationTime: time.Date(2015, 2, 5, 21, 33, 10, 0, time.UTC),
+		UpdatedTime:  gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC)),
+		CreationTime: gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 5, 21, 33, 10, 0, time.UTC)),
 		RequiredBy:   []interface{}{},
 		Status:       "CREATE_IN_PROGRESS",
 		PhysicalID:   "49181cd6-169a-4130-9455-31185bbfc5bf",
@@ -176,7 +176,7 @@
 	LogicalID:    "wordpress_instance",
 	Attributes:   map[string]interface{}{"SXSW": "atx"},
 	StatusReason: "state changed",
-	UpdatedTime:  time.Date(2014, 12, 10, 18, 34, 35, 0, time.UTC),
+	UpdatedTime:  gophercloud.JSONRFC3339NoZ(time.Date(2014, 12, 10, 18, 34, 35, 0, time.UTC)),
 	RequiredBy:   []interface{}{},
 	Status:       "CREATE_COMPLETE",
 	PhysicalID:   "00e3a2fe-c65d-403c-9483-4db9930dd194",
diff --git a/openstack/orchestration/v1/stackresources/results.go b/openstack/orchestration/v1/stackresources/results.go
index edbd34f..951f144 100644
--- a/openstack/orchestration/v1/stackresources/results.go
+++ b/openstack/orchestration/v1/stackresources/results.go
@@ -2,29 +2,25 @@
 
 import (
 	"encoding/json"
-	"fmt"
-	"reflect"
-	"time"
 
-	"github.com/mitchellh/mapstructure"
 	"github.com/gophercloud/gophercloud"
 	"github.com/gophercloud/gophercloud/pagination"
 )
 
 // Resource represents a stack resource.
 type Resource struct {
-	Attributes   map[string]interface{} `mapstructure:"attributes"`
-	CreationTime time.Time              `mapstructure:"-"`
-	Description  string                 `mapstructure:"description"`
-	Links        []gophercloud.Link     `mapstructure:"links"`
-	LogicalID    string                 `mapstructure:"logical_resource_id"`
-	Name         string                 `mapstructure:"resource_name"`
-	PhysicalID   string                 `mapstructure:"physical_resource_id"`
-	RequiredBy   []interface{}          `mapstructure:"required_by"`
-	Status       string                 `mapstructure:"resource_status"`
-	StatusReason string                 `mapstructure:"resource_status_reason"`
-	Type         string                 `mapstructure:"resource_type"`
-	UpdatedTime  time.Time              `mapstructure:"-"`
+	Attributes   map[string]interface{}     `json:"attributes"`
+	CreationTime gophercloud.JSONRFC3339NoZ `json:"creation_time"`
+	Description  string                     `json:"description"`
+	Links        []gophercloud.Link         `json:"links"`
+	LogicalID    string                     `json:"logical_resource_id"`
+	Name         string                     `json:"resource_name"`
+	PhysicalID   string                     `json:"physical_resource_id"`
+	RequiredBy   []interface{}              `json:"required_by"`
+	Status       string                     `json:"resource_status"`
+	StatusReason string                     `json:"resource_status_reason"`
+	Type         string                     `json:"resource_type"`
+	UpdatedTime  gophercloud.JSONRFC3339NoZ `json:"updated_time"`
 }
 
 // FindResult represents the result of a Find operation.
@@ -35,39 +31,11 @@
 // Extract returns a slice of Resource objects and is called after a
 // Find operation.
 func (r FindResult) Extract() ([]Resource, error) {
-	if r.Err != nil {
-		return nil, r.Err
+	var s struct {
+		Resources []Resource `json:"resources"`
 	}
-
-	var res struct {
-		Res []Resource `mapstructure:"resources"`
-	}
-
-	if err := mapstructure.Decode(r.Body, &res); err != nil {
-		return nil, err
-	}
-
-	resources := r.Body.(map[string]interface{})["resources"].([]interface{})
-
-	for i, resourceRaw := range resources {
-		resource := resourceRaw.(map[string]interface{})
-		if date, ok := resource["updated_time"]; ok && date != nil {
-			t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-			if err != nil {
-				return nil, err
-			}
-			res.Res[i].UpdatedTime = t
-		}
-		if date, ok := resource["creation_time"]; ok && date != nil {
-			t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-			if err != nil {
-				return nil, err
-			}
-			res.Res[i].CreationTime = t
-		}
-	}
-
-	return res.Res, nil
+	err := r.ExtractInto(&s)
+	return s.Resources, err
 }
 
 // ResourcePage abstracts the raw results of making a List() request against the API.
@@ -80,51 +48,16 @@
 // IsEmpty returns true if a page contains no Server results.
 func (r ResourcePage) IsEmpty() (bool, error) {
 	resources, err := ExtractResources(r)
-	if err != nil {
-		return true, err
-	}
-	return len(resources) == 0, nil
+	return len(resources) == 0, err
 }
 
 // ExtractResources interprets the results of a single page from a List() call, producing a slice of Resource entities.
-func ExtractResources(page pagination.Page) ([]Resource, error) {
-	casted := page.(ResourcePage).Body
-
-	var response struct {
-		Resources []Resource `mapstructure:"resources"`
+func ExtractResources(r pagination.Page) ([]Resource, error) {
+	var s struct {
+		Resources []Resource `json:"resources"`
 	}
-	if err := mapstructure.Decode(casted, &response); err != nil {
-		return nil, err
-	}
-	var resources []interface{}
-	switch casted.(type) {
-	case map[string]interface{}:
-		resources = casted.(map[string]interface{})["resources"].([]interface{})
-	case map[string][]interface{}:
-		resources = casted.(map[string][]interface{})["resources"]
-	default:
-		return response.Resources, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted))
-	}
-
-	for i, resourceRaw := range resources {
-		resource := resourceRaw.(map[string]interface{})
-		if date, ok := resource["updated_time"]; ok && date != nil {
-			t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-			if err != nil {
-				return nil, err
-			}
-			response.Resources[i].UpdatedTime = t
-		}
-		if date, ok := resource["creation_time"]; ok && date != nil {
-			t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-			if err != nil {
-				return nil, err
-			}
-			response.Resources[i].CreationTime = t
-		}
-	}
-
-	return response.Resources, nil
+	err := (r.(ResourcePage)).ExtractInto(&s)
+	return s.Resources, err
 }
 
 // GetResult represents the result of a Get operation.
@@ -135,36 +68,11 @@
 // Extract returns a pointer to a Resource object and is called after a
 // Get operation.
 func (r GetResult) Extract() (*Resource, error) {
-	if r.Err != nil {
-		return nil, r.Err
+	var s struct {
+		Resource *Resource `json:"resource"`
 	}
-
-	var res struct {
-		Res *Resource `mapstructure:"resource"`
-	}
-
-	if err := mapstructure.Decode(r.Body, &res); err != nil {
-		return nil, err
-	}
-
-	resource := r.Body.(map[string]interface{})["resource"].(map[string]interface{})
-
-	if date, ok := resource["updated_time"]; ok && date != nil {
-		t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-		if err != nil {
-			return nil, err
-		}
-		res.Res.UpdatedTime = t
-	}
-	if date, ok := resource["creation_time"]; ok && date != nil {
-		t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-		if err != nil {
-			return nil, err
-		}
-		res.Res.CreationTime = t
-	}
-
-	return res.Res, nil
+	err := r.ExtractInto(&s)
+	return s.Resource, err
 }
 
 // MetadataResult represents the result of a Metadata operation.
@@ -175,19 +83,11 @@
 // Extract returns a map object and is called after a
 // Metadata operation.
 func (r MetadataResult) Extract() (map[string]string, error) {
-	if r.Err != nil {
-		return nil, r.Err
+	var s struct {
+		Meta map[string]string `json:"metadata"`
 	}
-
-	var res struct {
-		Meta map[string]string `mapstructure:"metadata"`
-	}
-
-	if err := mapstructure.Decode(r.Body, &res); err != nil {
-		return nil, err
-	}
-
-	return res.Meta, nil
+	err := r.ExtractInto(&s)
+	return s.Meta, err
 }
 
 // ResourceTypePage abstracts the raw results of making a ListTypes() request against the API.
@@ -200,10 +100,7 @@
 // IsEmpty returns true if a ResourceTypePage contains no resource types.
 func (r ResourceTypePage) IsEmpty() (bool, error) {
 	rts, err := ExtractResourceTypes(r)
-	if err != nil {
-		return true, err
-	}
-	return len(rts) == 0, nil
+	return len(rts) == 0, err
 }
 
 // ResourceTypes represents the type that holds the result of ExtractResourceTypes.
@@ -223,25 +120,20 @@
 }
 
 // ExtractResourceTypes extracts and returns resource types.
-func ExtractResourceTypes(page pagination.Page) (ResourceTypes, error) {
-	casted := page.(ResourceTypePage).Body
-
-	var response struct {
-		ResourceTypes ResourceTypes `mapstructure:"resource_types"`
+func ExtractResourceTypes(r pagination.Page) (ResourceTypes, error) {
+	var s struct {
+		ResourceTypes ResourceTypes `json:"resource_types"`
 	}
-
-	if err := mapstructure.Decode(casted, &response); err != nil {
-		return nil, err
-	}
-	return response.ResourceTypes, nil
+	err := (r.(ResourceTypePage)).ExtractInto(&s)
+	return s.ResourceTypes, err
 }
 
 // TypeSchema represents a stack resource schema.
 type TypeSchema struct {
-	Attributes    map[string]interface{} `mapstructure:"attributes"`
-	Properties    map[string]interface{} `mapstrucutre:"properties"`
-	ResourceType  string                 `mapstructure:"resource_type"`
-	SupportStatus map[string]interface{} `mapstructure:"support_status"`
+	Attributes    map[string]interface{} `json:"attributes"`
+	Properties    map[string]interface{} `json:"properties"`
+	ResourceType  string                 `json:"resource_type"`
+	SupportStatus map[string]interface{} `json:"support_status"`
 }
 
 // SchemaResult represents the result of a Schema operation.
@@ -252,17 +144,9 @@
 // Extract returns a pointer to a TypeSchema object and is called after a
 // Schema operation.
 func (r SchemaResult) Extract() (*TypeSchema, error) {
-	if r.Err != nil {
-		return nil, r.Err
-	}
-
-	var res TypeSchema
-
-	if err := mapstructure.Decode(r.Body, &res); err != nil {
-		return nil, err
-	}
-
-	return &res, nil
+	var s *TypeSchema
+	err := r.ExtractInto(&s)
+	return s, err
 }
 
 // TemplateResult represents the result of a Template operation.
diff --git a/openstack/orchestration/v1/stacks/fixtures.go b/openstack/orchestration/v1/stacks/fixtures.go
index 49e4168..f1d66f4 100644
--- a/openstack/orchestration/v1/stacks/fixtures.go
+++ b/openstack/orchestration/v1/stacks/fixtures.go
@@ -60,7 +60,7 @@
 		},
 		StatusReason: "Stack CREATE completed successfully",
 		Name:         "postman_stack",
-		CreationTime: time.Date(2015, 2, 3, 20, 7, 39, 0, time.UTC),
+		CreationTime: gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 3, 20, 7, 39, 0, time.UTC)),
 		Status:       "CREATE_COMPLETE",
 		ID:           "16ef0584-4458-41eb-87c8-0dc8d5f66c87",
 		Tags:         []string{"rackspace", "atx"},
@@ -75,8 +75,8 @@
 		},
 		StatusReason: "Stack successfully updated",
 		Name:         "gophercloud-test-stack-2",
-		CreationTime: time.Date(2014, 12, 11, 17, 39, 16, 0, time.UTC),
-		UpdatedTime:  time.Date(2014, 12, 11, 17, 40, 37, 0, time.UTC),
+		CreationTime: gophercloud.JSONRFC3339NoZ(time.Date(2014, 12, 11, 17, 39, 16, 0, time.UTC)),
+		UpdatedTime:  gophercloud.JSONRFC3339NoZ(time.Date(2014, 12, 11, 17, 40, 37, 0, time.UTC)),
 		Status:       "UPDATE_COMPLETE",
 		ID:           "db6977b2-27aa-4775-9ae7-6213212d4ada",
 		Tags:         []string{"sfo", "satx"},
@@ -157,7 +157,7 @@
 	StatusReason: "Stack CREATE completed successfully",
 	Name:         "postman_stack",
 	Outputs:      []map[string]interface{}{},
-	CreationTime: time.Date(2015, 2, 3, 20, 7, 39, 0, time.UTC),
+	CreationTime: gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 3, 20, 7, 39, 0, time.UTC)),
 	Links: []gophercloud.Link{
 		gophercloud.Link{
 			Href: "http://166.76.160.117:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87",
@@ -255,7 +255,7 @@
 		"OS::stack_id":   "16ef0584-4458-41eb-87c8-0dc8d5f66c87",
 	},
 	Name:         "postman_stack",
-	CreationTime: time.Date(2015, 2, 3, 20, 7, 39, 0, time.UTC),
+	CreationTime: gophercloud.JSONRFC3339NoZ(time.Date(2015, 2, 3, 20, 7, 39, 0, time.UTC)),
 	Links: []gophercloud.Link{
 		gophercloud.Link{
 			Href: "http://166.76.160.117:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87",
diff --git a/openstack/orchestration/v1/stacks/results.go b/openstack/orchestration/v1/stacks/results.go
index 72855ff..5da178e 100644
--- a/openstack/orchestration/v1/stacks/results.go
+++ b/openstack/orchestration/v1/stacks/results.go
@@ -2,19 +2,15 @@
 
 import (
 	"encoding/json"
-	"fmt"
-	"reflect"
-	"time"
 
-	"github.com/mitchellh/mapstructure"
 	"github.com/gophercloud/gophercloud"
 	"github.com/gophercloud/gophercloud/pagination"
 )
 
 // CreatedStack represents the object extracted from a Create operation.
 type CreatedStack struct {
-	ID    string             `mapstructure:"id"`
-	Links []gophercloud.Link `mapstructure:"links"`
+	ID    string             `json:"id"`
+	Links []gophercloud.Link `json:"links"`
 }
 
 // CreateResult represents the result of a Create operation.
@@ -25,19 +21,11 @@
 // Extract returns a pointer to a CreatedStack object and is called after a
 // Create operation.
 func (r CreateResult) Extract() (*CreatedStack, error) {
-	if r.Err != nil {
-		return nil, r.Err
+	var s struct {
+		CreatedStack *CreatedStack `json:"stack"`
 	}
-
-	var res struct {
-		Stack *CreatedStack `mapstructure:"stack"`
-	}
-
-	if err := mapstructure.Decode(r.Body, &res); err != nil {
-		return nil, err
-	}
-
-	return res.Stack, nil
+	err := r.ExtractInto(&s)
+	return s.CreatedStack, err
 }
 
 // AdoptResult represents the result of an Adopt operation. AdoptResult has the
@@ -54,90 +42,50 @@
 // IsEmpty returns true if a ListResult contains no Stacks.
 func (r StackPage) IsEmpty() (bool, error) {
 	stacks, err := ExtractStacks(r)
-	if err != nil {
-		return true, err
-	}
-	return len(stacks) == 0, nil
+	return len(stacks) == 0, err
 }
 
 // ListedStack represents an element in the slice extracted from a List operation.
 type ListedStack struct {
-	CreationTime time.Time          `mapstructure:"-"`
-	Description  string             `mapstructure:"description"`
-	ID           string             `mapstructure:"id"`
-	Links        []gophercloud.Link `mapstructure:"links"`
-	Name         string             `mapstructure:"stack_name"`
-	Status       string             `mapstructure:"stack_status"`
-	StatusReason string             `mapstructure:"stack_status_reason"`
-	Tags         []string           `mapstructure:"tags"`
-	UpdatedTime  time.Time          `mapstructure:"-"`
+	CreationTime gophercloud.JSONRFC3339NoZ `json:"creation_time"`
+	Description  string                     `json:"description"`
+	ID           string                     `json:"id"`
+	Links        []gophercloud.Link         `json:"links"`
+	Name         string                     `json:"stack_name"`
+	Status       string                     `json:"stack_status"`
+	StatusReason string                     `json:"stack_status_reason"`
+	Tags         []string                   `json:"tags"`
+	UpdatedTime  gophercloud.JSONRFC3339NoZ `json:"updated_time"`
 }
 
 // ExtractStacks extracts and returns a slice of ListedStack. It is used while iterating
 // over a stacks.List call.
-func ExtractStacks(page pagination.Page) ([]ListedStack, error) {
-	casted := page.(StackPage).Body
-
-	var res struct {
-		Stacks []ListedStack `mapstructure:"stacks"`
+func ExtractStacks(r pagination.Page) ([]ListedStack, error) {
+	var s struct {
+		ListedStacks []ListedStack `json:"stacks"`
 	}
-
-	err := mapstructure.Decode(casted, &res)
-	if err != nil {
-		return nil, err
-	}
-
-	var rawStacks []interface{}
-	switch casted.(type) {
-	case map[string]interface{}:
-		rawStacks = casted.(map[string]interface{})["stacks"].([]interface{})
-	case map[string][]interface{}:
-		rawStacks = casted.(map[string][]interface{})["stacks"]
-	default:
-		return res.Stacks, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted))
-	}
-
-	for i := range rawStacks {
-		thisStack := (rawStacks[i]).(map[string]interface{})
-
-		if t, ok := thisStack["creation_time"].(string); ok && t != "" {
-			creationTime, err := time.Parse(gophercloud.StackFmtTime, t)
-			if err != nil {
-				return res.Stacks, err
-			}
-			res.Stacks[i].CreationTime = creationTime
-		}
-
-		if t, ok := thisStack["updated_time"].(string); ok && t != "" {
-			updatedTime, err := time.Parse(gophercloud.StackFmtTime, t)
-			if err != nil {
-				return res.Stacks, err
-			}
-			res.Stacks[i].UpdatedTime = updatedTime
-		}
-	}
-
-	return res.Stacks, nil
+	err := (r.(StackPage)).ExtractInto(&s)
+	return s.ListedStacks, err
 }
 
 // RetrievedStack represents the object extracted from a Get operation.
 type RetrievedStack struct {
-	Capabilities        []interface{}            `mapstructure:"capabilities"`
-	CreationTime        time.Time                `mapstructure:"-"`
-	Description         string                   `mapstructure:"description"`
-	DisableRollback     bool                     `mapstructure:"disable_rollback"`
-	ID                  string                   `mapstructure:"id"`
-	Links               []gophercloud.Link       `mapstructure:"links"`
-	NotificationTopics  []interface{}            `mapstructure:"notification_topics"`
-	Outputs             []map[string]interface{} `mapstructure:"outputs"`
-	Parameters          map[string]string        `mapstructure:"parameters"`
-	Name                string                   `mapstructure:"stack_name"`
-	Status              string                   `mapstructure:"stack_status"`
-	StatusReason        string                   `mapstructure:"stack_status_reason"`
-	Tags                []string                 `mapstructure:"tags"`
-	TemplateDescription string                   `mapstructure:"template_description"`
-	Timeout             int                      `mapstructure:"timeout_mins"`
-	UpdatedTime         time.Time                `mapstructure:"-"`
+	Capabilities        []interface{}              `json:"capabilities"`
+	CreationTime        gophercloud.JSONRFC3339NoZ `json:"creation_time"`
+	Description         string                     `json:"description"`
+	DisableRollback     bool                       `json:"disable_rollback"`
+	ID                  string                     `json:"id"`
+	Links               []gophercloud.Link         `json:"links"`
+	NotificationTopics  []interface{}              `json:"notification_topics"`
+	Outputs             []map[string]interface{}   `json:"outputs"`
+	Parameters          map[string]string          `json:"parameters"`
+	Name                string                     `json:"stack_name"`
+	Status              string                     `json:"stack_status"`
+	StatusReason        string                     `json:"stack_status_reason"`
+	Tags                []string                   `json:"tags"`
+	TemplateDescription string                     `json:"template_description"`
+	Timeout             int                        `json:"timeout_mins"`
+	UpdatedTime         gophercloud.JSONRFC3339NoZ `json:"updated_time"`
 }
 
 // GetResult represents the result of a Get operation.
@@ -148,46 +96,11 @@
 // Extract returns a pointer to a RetrievedStack object and is called after a
 // Get operation.
 func (r GetResult) Extract() (*RetrievedStack, error) {
-	if r.Err != nil {
-		return nil, r.Err
+	var s struct {
+		Stack *RetrievedStack `json:"stack"`
 	}
-
-	var res struct {
-		Stack *RetrievedStack `mapstructure:"stack"`
-	}
-
-	config := &mapstructure.DecoderConfig{
-		Result:           &res,
-		WeaklyTypedInput: true,
-	}
-	decoder, err := mapstructure.NewDecoder(config)
-	if err != nil {
-		return nil, err
-	}
-
-	if err := decoder.Decode(r.Body); err != nil {
-		return nil, err
-	}
-
-	b := r.Body.(map[string]interface{})["stack"].(map[string]interface{})
-
-	if date, ok := b["creation_time"]; ok && date != nil {
-		t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-		if err != nil {
-			return nil, err
-		}
-		res.Stack.CreationTime = t
-	}
-
-	if date, ok := b["updated_time"]; ok && date != nil {
-		t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-		if err != nil {
-			return nil, err
-		}
-		res.Stack.UpdatedTime = t
-	}
-
-	return res.Stack, err
+	err := r.ExtractInto(&s)
+	return s.Stack, err
 }
 
 // UpdateResult represents the result of a Update operation.
@@ -202,19 +115,19 @@
 
 // PreviewedStack represents the result of a Preview operation.
 type PreviewedStack struct {
-	Capabilities        []interface{}      `mapstructure:"capabilities"`
-	CreationTime        time.Time          `mapstructure:"-"`
-	Description         string             `mapstructure:"description"`
-	DisableRollback     bool               `mapstructure:"disable_rollback"`
-	ID                  string             `mapstructure:"id"`
-	Links               []gophercloud.Link `mapstructure:"links"`
-	Name                string             `mapstructure:"stack_name"`
-	NotificationTopics  []interface{}      `mapstructure:"notification_topics"`
-	Parameters          map[string]string  `mapstructure:"parameters"`
-	Resources           []interface{}      `mapstructure:"resources"`
-	TemplateDescription string             `mapstructure:"template_description"`
-	Timeout             int                `mapstructure:"timeout_mins"`
-	UpdatedTime         time.Time          `mapstructure:"-"`
+	Capabilities        []interface{}              `json:"capabilities"`
+	CreationTime        gophercloud.JSONRFC3339NoZ `json:"creation_time"`
+	Description         string                     `json:"description"`
+	DisableRollback     bool                       `json:"disable_rollback"`
+	ID                  string                     `json:"id"`
+	Links               []gophercloud.Link         `json:"links"`
+	Name                string                     `json:"stack_name"`
+	NotificationTopics  []interface{}              `json:"notification_topics"`
+	Parameters          map[string]string          `json:"parameters"`
+	Resources           []interface{}              `json:"resources"`
+	TemplateDescription string                     `json:"template_description"`
+	Timeout             int                        `json:"timeout_mins"`
+	UpdatedTime         gophercloud.JSONRFC3339NoZ `json:"updated_time"`
 }
 
 // PreviewResult represents the result of a Preview operation.
@@ -225,60 +138,25 @@
 // Extract returns a pointer to a PreviewedStack object and is called after a
 // Preview operation.
 func (r PreviewResult) Extract() (*PreviewedStack, error) {
-	if r.Err != nil {
-		return nil, r.Err
+	var s struct {
+		PreviewedStack *PreviewedStack `json:"stack"`
 	}
-
-	var res struct {
-		Stack *PreviewedStack `mapstructure:"stack"`
-	}
-
-	config := &mapstructure.DecoderConfig{
-		Result:           &res,
-		WeaklyTypedInput: true,
-	}
-	decoder, err := mapstructure.NewDecoder(config)
-	if err != nil {
-		return nil, err
-	}
-
-	if err := decoder.Decode(r.Body); err != nil {
-		return nil, err
-	}
-
-	b := r.Body.(map[string]interface{})["stack"].(map[string]interface{})
-
-	if date, ok := b["creation_time"]; ok && date != nil {
-		t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-		if err != nil {
-			return nil, err
-		}
-		res.Stack.CreationTime = t
-	}
-
-	if date, ok := b["updated_time"]; ok && date != nil {
-		t, err := time.Parse(gophercloud.StackFmtTime, date.(string))
-		if err != nil {
-			return nil, err
-		}
-		res.Stack.UpdatedTime = t
-	}
-
-	return res.Stack, err
+	err := r.ExtractInto(&s)
+	return s.PreviewedStack, err
 }
 
 // AbandonedStack represents the result of an Abandon operation.
 type AbandonedStack struct {
-	Status             string                 `mapstructure:"status"`
-	Name               string                 `mapstructure:"name"`
-	Template           map[string]interface{} `mapstructure:"template"`
-	Action             string                 `mapstructure:"action"`
-	ID                 string                 `mapstructure:"id"`
-	Resources          map[string]interface{} `mapstructure:"resources"`
-	Files              map[string]string      `mapstructure:"files"`
-	StackUserProjectID string                 `mapstructure:"stack_user_project_id"`
-	ProjectID          string                 `mapstructure:"project_id"`
-	Environment        map[string]interface{} `mapstructure:"environment"`
+	Status             string                 `json:"status"`
+	Name               string                 `json:"name"`
+	Template           map[string]interface{} `json:"template"`
+	Action             string                 `json:"action"`
+	ID                 string                 `json:"id"`
+	Resources          map[string]interface{} `json:"resources"`
+	Files              map[string]string      `json:"files"`
+	StackUserProjectID string                 `json:"stack_user_project_id"`
+	ProjectID          string                 `json:"project_id"`
+	Environment        map[string]interface{} `json:"environment"`
 }
 
 // AbandonResult represents the result of an Abandon operation.
@@ -289,17 +167,9 @@
 // Extract returns a pointer to an AbandonedStack object and is called after an
 // Abandon operation.
 func (r AbandonResult) Extract() (*AbandonedStack, error) {
-	if r.Err != nil {
-		return nil, r.Err
-	}
-
-	var res AbandonedStack
-
-	if err := mapstructure.Decode(r.Body, &res); err != nil {
-		return nil, err
-	}
-
-	return &res, nil
+	var s *AbandonedStack
+	err := r.ExtractInto(&s)
+	return s, err
 }
 
 // String converts an AbandonResult to a string. This is useful to when passing
diff --git a/openstack/orchestration/v1/stacktemplates/results.go b/openstack/orchestration/v1/stacktemplates/results.go
index 7f4ea25..bca959b 100644
--- a/openstack/orchestration/v1/stacktemplates/results.go
+++ b/openstack/orchestration/v1/stacktemplates/results.go
@@ -2,7 +2,7 @@
 
 import (
 	"encoding/json"
-	"github.com/mitchellh/mapstructure"
+
 	"github.com/gophercloud/gophercloud"
 )
 
@@ -25,9 +25,9 @@
 
 // ValidatedTemplate represents the parsed object returned from a Validate request.
 type ValidatedTemplate struct {
-	Description     string                 `mapstructure:"Description"`
-	Parameters      map[string]interface{} `mapstructure:"Parameters"`
-	ParameterGroups map[string]interface{} `mapstructure:"ParameterGroups"`
+	Description     string                 `json:"Description"`
+	Parameters      map[string]interface{} `json:"Parameters"`
+	ParameterGroups map[string]interface{} `json:"ParameterGroups"`
 }
 
 // ValidateResult represents the result of a Validate operation.
@@ -38,14 +38,7 @@
 // Extract returns a pointer to a ValidatedTemplate object and is called after a
 // Validate operation.
 func (r ValidateResult) Extract() (*ValidatedTemplate, error) {
-	if r.Err != nil {
-		return nil, r.Err
-	}
-
-	var res ValidatedTemplate
-	if err := mapstructure.Decode(r.Body, &res); err != nil {
-		return nil, err
-	}
-
-	return &res, nil
+	var s *ValidatedTemplate
+	err := r.ExtractInto(&s)
+	return s, err
 }
