diff --git a/src/parser/assignments.rs b/src/parser/assignments.rs
index a7173e1749d74e284485fee722949473f1472d7e..416990c8c29497f362138b902f3d1af4e6145b07 100644
--- a/src/parser/assignments.rs
+++ b/src/parser/assignments.rs
@@ -31,36 +31,27 @@ enum Expression {
 }
 
 fn parse_expression(expression: &str, shell_funcs: &ExpanderFunctions) -> Value {
-    let kind = Expression::Regular;
+    let arguments: Vec<&str> = ArgumentSplitter::new(expression).collect();
 
-    match kind {
-        // TODO: Determine if the expression is an arithmetic expression or not
-        Expression::Arithmetic => unimplemented!(),
-        // Expands the supplied expression normally
-        Expression::Regular => {
-            let arguments: Vec<&str> = ArgumentSplitter::new(expression).collect();
-
-            if arguments.len() == 1 {
-                // If a single argument has been passed, it will be expanded and checked to determine
-                // whether or not the expression is an array or a string.
-                let mut expanded = expand_string(expression, shell_funcs, false);
-                if expanded.len() == 1 {
-                    // Grab the inner value and return it as a String.
-                    Value::String(expanded.drain(..).next().unwrap())
-                } else {
-                    // Return the expanded values as an Array.
-                    Value::Array(expanded)
-                }
-            } else {
-                // If multiple arguments have been passed, they will be collapsed into a single string.
-                // IE: `[ one two three ] four` is equivalent to `one two three four`
-                let arguments: Vec<String> = arguments.iter()
-                    .flat_map(|expression| expand_string(expression, shell_funcs, false))
-                    .collect();
-
-                Value::String(arguments.join(" "))
-            }
+    if arguments.len() == 1 {
+        // If a single argument has been passed, it will be expanded and checked to determine
+        // whether or not the expression is an array or a string.
+        let expanded = expand_string(expression, shell_funcs, false);
+        if expanded.len() == 1 {
+            // Grab the inner value and return it as a String.
+            Value::String(expanded[0].clone())
+        } else {
+            // Return the expanded values as an Array.
+            Value::Array(expanded)
         }
+    } else {
+        // If multiple arguments have been passed, they will be collapsed into a single string.
+        // IE: `[ one two three ] four` is equivalent to `one two three four`
+        let arguments: Vec<String> = arguments.iter()
+            .flat_map(|expression| expand_string(expression, shell_funcs, false))
+            .collect();
+
+        Value::String(arguments.join(" "))
     }
 }
 
diff --git a/src/parser/shell_expand/mod.rs b/src/parser/shell_expand/mod.rs
index 12407c650fb348344864ffa442af8e0253abbc21..fe4bf1f515d81461e70bdc42aee081ceb8b8727e 100644
--- a/src/parser/shell_expand/mod.rs
+++ b/src/parser/shell_expand/mod.rs
@@ -34,7 +34,7 @@ fn expand_process(current: &mut String, command: &str, quoted: bool,
         tokens.push(token);
     }
 
-    let expanded = expand_tokens(tokens, expand_func, false, contains_brace).join(" ");
+    let expanded = expand_tokens(&tokens, expand_func, false, contains_brace).join(" ");
 
     if let Some(result) = (expand_func.command)(&expanded, quoted) {
         slice_string(current, &result, index);
@@ -42,7 +42,7 @@ fn expand_process(current: &mut String, command: &str, quoted: bool,
 }
 
 fn expand_brace(current: &mut String, expanders: &mut Vec<Vec<String>>,
-    tokens: &mut Vec<BraceToken>, nodes: Vec<&str>, expand_func: &ExpanderFunctions,
+    tokens: &mut Vec<BraceToken>, nodes: &[&str], expand_func: &ExpanderFunctions,
     reverse_quoting: bool)
 {
     let mut temp = Vec::new();
@@ -126,11 +126,11 @@ pub fn expand_string(original: &str, expand_func: &ExpanderFunctions, reverse_qu
         token_buffer.push(word);
     }
 
-    expand_tokens(token_buffer, expand_func, reverse_quoting, contains_brace)
+    expand_tokens(&token_buffer, expand_func, reverse_quoting, contains_brace)
 }
 
 #[allow(cyclomatic_complexity)]
-pub fn expand_tokens(mut token_buffer: Vec<WordToken>, expand_func: &ExpanderFunctions,
+pub fn expand_tokens(token_buffer: &[WordToken], expand_func: &ExpanderFunctions,
     reverse_quoting: bool, contains_brace: bool) -> Vec<String>
 {
     let mut output = String::new();
@@ -141,21 +141,21 @@ pub fn expand_tokens(mut token_buffer: Vec<WordToken>, expand_func: &ExpanderFun
             let mut tokens: Vec<BraceToken> = Vec::new();
             let mut expanders: Vec<Vec<String>> = Vec::new();
 
-            for word in token_buffer.drain(..) {
-                match word {
-                    WordToken::Array(elements, index) => {
+            for word in token_buffer {
+                match *word {
+                    WordToken::Array(ref elements, index) => {
                         match index {
                             Index::None => (),
                             Index::All => {
-                                let expanded = array_expand(&elements, expand_func);
+                                let expanded = array_expand(elements, expand_func);
                                 output.push_str(&expanded.join(" "));
                             },
                             Index::ID(id) => {
-                                let expanded = array_nth(&elements, expand_func, id);
+                                let expanded = array_nth(elements, expand_func, id);
                                 output.push_str(&expanded);
                             },
                             Index::Range(start, end) => {
-                                let expanded = array_range(&elements, expand_func, start, end);
+                                let expanded = array_range(elements, expand_func, start, end);
                                 output.push_str(&expanded.join(" "));
                             }
                         };
@@ -194,7 +194,7 @@ pub fn expand_tokens(mut token_buffer: Vec<WordToken>, expand_func: &ExpanderFun
                             }
                         }
                     },
-                    WordToken::ArrayMethod(array_method) => {
+                    WordToken::ArrayMethod(ref array_method) => {
                         array_method.handle(&mut output, expand_func);
                     },
                     WordToken::StringMethod(method, variable, pattern, index) => {
@@ -210,7 +210,7 @@ pub fn expand_tokens(mut token_buffer: Vec<WordToken>, expand_func: &ExpanderFun
                             }
                         }
                     },
-                    WordToken::Brace(nodes) =>
+                    WordToken::Brace(ref nodes) =>
                         expand_brace(&mut output, &mut expanders, &mut tokens, nodes, expand_func, reverse_quoting),
                     WordToken::Normal(text) => output.push_str(text),
                     WordToken::Whitespace(_) => unreachable!(),
@@ -247,13 +247,13 @@ pub fn expand_tokens(mut token_buffer: Vec<WordToken>, expand_func: &ExpanderFun
 
             return expanded_words
         } else if token_buffer.len() == 1 {
-            match token_buffer[0].clone() {
-                WordToken::Array(elements, index) => {
+            match token_buffer[0] {
+                WordToken::Array(ref elements, index) => {
                     return match index {
                         Index::None   => Vec::new(),
-                        Index::All    => array_expand(&elements, expand_func),
-                        Index::ID(id) => vec![array_nth(&elements, expand_func, id)],
-                        Index::Range(start, end) => array_range(&elements, expand_func, start, end),
+                        Index::All    => array_expand(elements, expand_func),
+                        Index::ID(id) => vec![array_nth(elements, expand_func, id)],
+                        Index::Range(start, end) => array_range(elements, expand_func, start, end),
                     };
                 },
                 WordToken::ArrayVariable(array, quoted, index) => {
@@ -286,28 +286,28 @@ pub fn expand_tokens(mut token_buffer: Vec<WordToken>, expand_func: &ExpanderFun
                         },
                     }
                 },
-                WordToken::ArrayMethod(array_method) => {
+                WordToken::ArrayMethod(ref array_method) => {
                     return array_method.handle_as_array(expand_func);
                 },
                 _ => ()
             }
         }
 
-        for word in token_buffer.drain(..) {
-            match word {
-                WordToken::Array(elements, index) => {
+        for word in token_buffer {
+            match *word {
+                WordToken::Array(ref elements, index) => {
                     match index {
                         Index::None => (),
                         Index::All => {
-                            let expanded = array_expand(&elements, expand_func);
+                            let expanded = array_expand(elements, expand_func);
                             output.push_str(&expanded.join(" "));
                         },
                         Index::ID(id) => {
-                            let expanded = array_nth(&elements, expand_func, id);
+                            let expanded = array_nth(elements, expand_func, id);
                             output.push_str(&expanded);
                         },
                         Index::Range(start, end) => {
-                            let expanded = array_range(&elements, expand_func, start, end);
+                            let expanded = array_range(elements, expand_func, start, end);
                             output.push_str(&expanded.join(" "));
                         },
                     };
@@ -346,7 +346,7 @@ pub fn expand_tokens(mut token_buffer: Vec<WordToken>, expand_func: &ExpanderFun
                         },
                     }
                 },
-                WordToken::ArrayMethod(array_method) => {
+                WordToken::ArrayMethod(ref array_method) => {
                     array_method.handle(&mut output, expand_func);
                 },
                 WordToken::StringMethod(method, variable, pattern, index) => {
diff --git a/src/parser/shell_expand/words.rs b/src/parser/shell_expand/words.rs
index 51234876101de78b8e8139e225a5d1b28f61f7ce..a33e433dbee9cd81e59272e64d30083d106d023a 100644
--- a/src/parser/shell_expand/words.rs
+++ b/src/parser/shell_expand/words.rs
@@ -71,32 +71,32 @@ pub struct ArrayMethod<'a> {
 }
 
 impl<'a> ArrayMethod<'a> {
-    pub fn handle(self, current: &mut String, expand_func: &ExpanderFunctions) {
+    pub fn handle(&self, current: &mut String, expand_func: &ExpanderFunctions) {
         match self.method {
             "split" => if let Some(variable) = (expand_func.variable)(self.variable, false) {
-                match (self.pattern, self.index) {
-                    (Pattern::StringPattern(pattern), Index::All) => current.push_str (
+                match (&self.pattern, self.index) {
+                    (&Pattern::StringPattern(pattern), Index::All) => current.push_str (
                         &variable.split(&expand_string(pattern, expand_func, false).join(" "))
                             .collect::<Vec<&str>>()
                             .join(" ")
                     ),
-                    (Pattern::Whitespace, Index::All) => current.push_str (
+                    (&Pattern::Whitespace, Index::All) => current.push_str (
                         &variable.split(char::is_whitespace)
                             .collect::<Vec<&str>>()
                             .join(" ")
                     ),
                     (_, Index::None) => (),
-                    (Pattern::StringPattern(pattern), Index::ID(id)) => current.push_str (
+                    (&Pattern::StringPattern(pattern), Index::ID(id)) => current.push_str (
                         variable.split(&expand_string(pattern, expand_func, false).join(" "))
                             .nth(id)
                             .unwrap_or_default()
                     ),
-                    (Pattern::Whitespace, Index::ID(id)) => current.push_str (
+                    (&Pattern::Whitespace, Index::ID(id)) => current.push_str (
                         variable.split(char::is_whitespace)
                             .nth(id)
                             .unwrap_or_default()
                     ),
-                    (Pattern::StringPattern(pattern), Index::Range(start, IndexEnd::ID(end))) => {
+                    (&Pattern::StringPattern(pattern), Index::Range(start, IndexEnd::ID(end))) => {
                         let range = variable.split(&expand_string(pattern, expand_func, false).join(" "))
                             .skip(start).take(end-start)
                             .collect::<Vec<&str>>()
@@ -104,7 +104,7 @@ impl<'a> ArrayMethod<'a> {
 
                         current.push_str(&range);
                     },
-                    (Pattern::Whitespace, Index::Range(start, IndexEnd::ID(end))) => {
+                    (&Pattern::Whitespace, Index::Range(start, IndexEnd::ID(end))) => {
                         let range = variable.split(char::is_whitespace)
                             .skip(start).take(end-start)
                             .collect::<Vec<&str>>()
@@ -112,7 +112,7 @@ impl<'a> ArrayMethod<'a> {
 
                         current.push_str(&range);
                     },
-                    (Pattern::StringPattern(pattern), Index::Range(start, IndexEnd::CatchAll)) => {
+                    (&Pattern::StringPattern(pattern), Index::Range(start, IndexEnd::CatchAll)) => {
                         let range = variable.split(&expand_string(pattern, expand_func, false).join(" "))
                             .skip(start)
                             .collect::<Vec<&str>>()
@@ -120,7 +120,7 @@ impl<'a> ArrayMethod<'a> {
 
                         current.push_str(&range);
                     }
-                    (Pattern::Whitespace, Index::Range(start, IndexEnd::CatchAll)) => {
+                    (&Pattern::Whitespace, Index::Range(start, IndexEnd::CatchAll)) => {
                         let range = variable.split(char::is_whitespace)
                             .skip(start)
                             .collect::<Vec<&str>>()
@@ -138,46 +138,46 @@ impl<'a> ArrayMethod<'a> {
         }
     }
 
-    pub fn handle_as_array(self, expand_func: &ExpanderFunctions) -> Vec<String> {
+    pub fn handle_as_array(&self, expand_func: &ExpanderFunctions) -> Vec<String> {
         match self.method {
             "split" => if let Some(variable) = (expand_func.variable)(self.variable, false) {
-                return match (self.pattern, self.index) {
+                return match (&self.pattern, self.index) {
                     (_, Index::None) => vec!["".to_owned()],
-                    (Pattern::StringPattern(pattern), Index::All) => variable
+                    (&Pattern::StringPattern(pattern), Index::All) => variable
                         .split(&expand_string(pattern, expand_func, false).join(" "))
                         .map(String::from)
                         .collect::<Vec<String>>(),
-                    (Pattern::Whitespace, Index::All) => variable
+                    (&Pattern::Whitespace, Index::All) => variable
                         .split(char::is_whitespace)
                         .map(String::from)
                         .collect::<Vec<String>>(),
-                    (Pattern::StringPattern(pattern), Index::ID(id)) => vec![variable
+                    (&Pattern::StringPattern(pattern), Index::ID(id)) => vec![variable
                         .split(&expand_string(pattern, expand_func, false).join(" "))
                         .nth(id).map(String::from)
                         .unwrap_or_default()],
-                    (Pattern::Whitespace, Index::ID(id)) => vec![variable
+                    (&Pattern::Whitespace, Index::ID(id)) => vec![variable
                         .split(char::is_whitespace)
                         .nth(id).map(String::from)
                         .unwrap_or_default()],
-                    (Pattern::StringPattern(pattern), Index::Range(start, IndexEnd::CatchAll)) => {
+                    (&Pattern::StringPattern(pattern), Index::Range(start, IndexEnd::CatchAll)) => {
                         variable.split(&expand_string(pattern, expand_func, false).join(" "))
                             .skip(start)
                             .map(String::from)
                             .collect::<Vec<String>>()
                     },
-                    (Pattern::Whitespace, Index::Range(start, IndexEnd::CatchAll)) => {
+                    (&Pattern::Whitespace, Index::Range(start, IndexEnd::CatchAll)) => {
                         variable.split(char::is_whitespace)
                             .skip(start)
                             .map(String::from)
                             .collect::<Vec<String>>()
                     },
-                    (Pattern::StringPattern(pattern), Index::Range(start, IndexEnd::ID(end))) => {
+                    (&Pattern::StringPattern(pattern), Index::Range(start, IndexEnd::ID(end))) => {
                         variable.split(&expand_string(pattern, expand_func, false).join(" ")).skip(start)
                             .take(end-start)
                             .map(String::from)
                             .collect::<Vec<String>>()
                     },
-                    (Pattern::Whitespace, Index::Range(start, IndexEnd::ID(end))) => {
+                    (&Pattern::Whitespace, Index::Range(start, IndexEnd::ID(end))) => {
                         variable.split(char::is_whitespace).skip(start)
                             .take(end-start)
                             .map(String::from)