The commit I forgot to commit last time.

Just a bit of cleanup, switching some chunks of code in and out.