Cleaned up a little bit of the code as a follow-up to last commit.