Okay refactored everything. Probably need to make some small changes but overall should be easier to work with