Part 2 of major code-cleanup. Good for now.