Rearranged Classes and packets. Refactored some of the code