First pass of rewriting/reorganizing things.