Massive code simplification.
Finally.