Some code cleanup. No functionality changes, just making it more readable.