Deleted a lot of cruft
Refactored a lot