Reorganize/clean up code a tiny bit.