refactored code to remove a lot of the cruftiness. Took a regression on the tests, but its worth it. It wont take long to bring it back better