package me.duncte123.skybot.utils;

import java.util.ArrayList;

import net.dv8tion.jda.core.events.message.MessageReceivedEvent;


public class CommandParser {

    public CommandContainer parse(String rw, MessageReceivedEvent e){
        ArrayList<String> split = new ArrayList<String>();
        String raw = rw;
        String beheaded = raw.replaceFirst(Config.prefix, "");
        String[] SplitBeheadded = beheaded.split(" ");
        for(String s : SplitBeheadded){split.add(s);}
        String invoke = split.get(0).toLowerCase();
        String[] args = new String[split.size() - 1];
        split.subList(1, split.size()).toArray(args);

        return new CommandContainer(raw, beheaded, SplitBeheadded, invoke, args, e);
    }

     public class CommandContainer {
         public final String raw;
         public final String beheaded;
         public final String[] SplitBeheadded;
         public final String invoke;
         public final String[] args;
         public final MessageReceivedEvent event;

         public CommandContainer(String rw, String beheaded, String[] SplitBeheaded, String invoke, String[] args, MessageReceivedEvent e){
             this.raw = rw;
             this.beheaded = beheaded;
             this.SplitBeheadded = SplitBeheaded;
             this.invoke = invoke;
             this.args = args;
             this.event = e;
         }
     }

}

@@ -56,16 +56,41 @@
 rayList;
+%0Aimport java.util.Arrays;
 %0A%0Aimport
@@ -258,33 +258,30 @@
         
-ArrayList%3C
+final 
 String
-%3E
+%5B%5D
  split =
@@ -285,237 +285,90 @@
 t = 
-new ArrayList%3CString%3E();%0A        String raw = rw;%0A        String beheaded = raw.replaceFirst(Config.prefix, %22%22);%0A        String%5B%5D SplitBeheadded = beheaded.split(%22 %22);%0A        for(String s : SplitBeheadded)%7Bsplit.add(s);%7D%0A       
+rw.substring(rw.indexOf(Config.prefix) + 1, rw.length()).split(%22 %22);%0A        final
  Str
@@ -389,29 +389,11 @@
 plit
-.get(0).toLowerCase()
+%5B0%5D
 ;%0A  
@@ -398,16 +398,22 @@
         
+final 
 String%5B%5D
@@ -424,89 +424,49 @@
 s = 
-new String%5Bsplit.size() - 1%5D;%0A        split.subList(1, split.size()).toArray(args
+Arrays.copyOfRange(split, 1, split.length
 );%0A%0A
@@ -505,39 +505,8 @@
 ner(
-raw, beheaded, SplitBeheadded, 
 invo
@@ -567,128 +567,8 @@
 r %7B%0A
-         public final String raw;%0A         public final String beheaded;%0A         public final String%5B%5D SplitBeheadded;%0A
     
@@ -732,224 +732,55 @@
 ing 
-rw, String beheaded, String%5B%5D SplitBeheaded, String invoke, String%5B%5D args, MessageReceivedEvent e)%7B%0A             this.raw = rw;%0A             this.beheaded = beheaded;%0A             this.SplitBeheadded = SplitBeheaded;
+invoke, String%5B%5D args, MessageReceivedEvent e)%7B
 %0A   

Optimise code