Cleaning and refacoring. Some pretty big improvements to code size.