Cleaned up some utility methods.