Clean repo

Cleaned up version of the codebase for review.
This method is way way way too long. Ideal lines of code per function should be < 10.